Search Postgresql Archives

Nested literal parsing rules?

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

 



Hi,

I have a UDT:

CREATE TYPE foo AS (a integer, b integer, c hstore);

I need to construct the literal representation of an array of these
for input to a textual COPY. The hstore escaping rules are fairly
clear (I can quote all keys and values with double quotes, and escape
double quotes in keys and values with a backslash (two backslahses,
actually, due to standard_conforming_strings being off). Putting this
into my UDT literal is also fairly clear (I quote the full hstore
literal with double quotes, I double the double quotes around hstore
keys and values, and add four more backslashes (one for the hstore
literal, one for the UDT literal, and double that for
standard_conforming_strings). So each quote in an hstore key or value
is preceded by six backslashes (and each backslash is preceded by
seven). However, this is where I get lost. I tried following both the
array docs and trying to reverse engineer the behavior by using the
ARRAY[...] syntax, but I can't figure out the logic. Any suggestions
(other than to run screaming from this affront to proper relational
design--I have my reasons for it)?

Thanks,
---
Maciek Sakrejda | System Architect | Truviso

1065 E. Hillsdale Blvd., Suite 215
Foster City, CA 94404
(650) 242-3500 Main
www.truviso.com

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[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