Search Postgresql Archives

Re: express composite type literal as text

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Feb 22, 2015 at 11:42 AM, Adrian Klaver <adrian.klaver@xxxxxxxxxxx> 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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux