Postgres - returning custom values ie. "true" rather than "t" I am wondering if there is a way to show custom "values" in the output of a query purely for readability, similar to the AS statement for renaming column labels.

Seems unlikely but would be useful for cutting down a number of custom post-query formatting steps.

ie.

| type (varchar) | status (boolean) |
| A              | t                |
| B              | f                |


as

| type  | status |
| A     | true   |
| B     | false  |


or

| type  | status     |
| A     | collecting |
| B     | disabled   |


I am aware I could change the database to contain these values, but this is not possible in this case.

Thanks
You can use a CASE WHEN clause to custom the output :

SELECT CASE WHEN status THEN 'true' 
            WHEN NOT status THEN 'false' 
            ELSE 'uknknown' 
       END AS status 
FROM mytable;


If you want to change the default output of PostgreSQL in order to output 'true' instead of 't', I'm pretty sure it is not possible.