agora inbox for pgsql-sql@postgresql.org
help / color / mirror / Atom feedFrom: gmb <gmbouwer@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Handle untype-cast string as VARCHAR instead of TEXT
Date: Tue, 17 May 2016 05:58:04 -0700 (MST)
Message-ID: <1463489884675-5903959.post@n5.nabble.com> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
view thread (3+ messages) latest in thread
Message-ID: <1463489884675-5903959.post@n5.nabble.com>
Permalink: ../1463489884675-5903959.post@n5.nabble.com/
Also on: postgresql.org/message-id/1463489884675-5903959.post@n5.nabble.com
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: gmbouwer@gmail.com
Subject: Re: Handle untype-cast string as VARCHAR instead of TEXT
In-Reply-To: <1463489884675-5903959.post@n5.nabble.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox