Re: express composite type literal as text - Mailing list pgsql-general

From Eric Hanson
Subject Re: express composite type literal as text
Date
Msg-id CACA6kxgGN=02BVVH8cCY3ecSrewaagcgd+CfrUg9pd8em-NV-g@mail.gmail.com
Whole thread Raw
In response to Re: express composite type literal as text  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
On Sun, Feb 22, 2015 at 11:42 AM, Adrian Klaver <adrian.klaver@aklaver.com> wrote:

test=> select * from on_hand where item = '("fuzzy dice",42,1.99)'::inventory_item;

          item          | count
------------------------+-------
 ("fuzzy dice",42,1.99) |  1000
(1 row)

So, you have to do the explicit cast?  It looks like it.  That's not ideal, we have relied on the assumption that all values (except for NULL) can be represented as text strings, and PostgreSQL will auto-cast the text to the appropriate type.  Is this case just an exception to a rule that is generally true and aimed for, or is that just not a good assumption?

Thanks,
Eric

pgsql-general by date:

Previous
From: Eric Hanson
Date:
Subject: Re: [BUGS] express composite type literal as text
Next
From: Eric Hanson
Date:
Subject: express composite type literal as text