| From: | gmb <gmbouwer(at)gmail(dot)com> |
|---|---|
| To: | pgsql-sql(at)postgresql(dot)org |
| Subject: | Handle untype-cast string as VARCHAR instead of TEXT |
| Date: | 2016-05-17 12:58:04 |
| Message-ID: | 1463489884675-5903959.post@n5.nabble.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-sql |
Hi all
I'm dealing with a system where string values is queried but not necessary
type-cast.
E.g.
SELECT case when some_value=1 then 'some string' else 'another string' end
FROM some_table;
This will return a column cast as type TEXT;
Is there some configuration option (or hack?) available which will return
above as VARCHAR ?
I'm using 3rd party software where a VARCHAR value displays much better than
TEXT.
I know best practice will be to type-cast , but I'm hoping for a quick-fix
here :)
Regards
--
View this message in context: http://postgresql.nabble.com/Handle-untype-cast-string-as-VARCHAR-instead-of-TEXT-tp5903959.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | David G. Johnston | 2016-05-17 13:19:44 | Re: Handle untype-cast string as VARCHAR instead of TEXT |
| Previous Message | Venkatesan, Sekhar | 2016-05-17 04:47:02 | Re: PostgreSQL:ALTER TABLE command hangs forever when DB partitioning is enabled. |