DELIVERY FAILURE: User laszlo_acs (laszlo_acs@cms.state.il.us) not listed in public Name & Address Book - Mailing list pgsql-sql

From Postmaster@state.il.us
Subject DELIVERY FAILURE: User laszlo_acs (laszlo_acs@cms.state.il.us) not listed in public Name & Address Book
Date
Msg-id 0002249514.AA951455191@ccmailgw.state.il.us
Whole thread Raw
List pgsql-sql
Your message

  Subject: Re: [INTERFACES] arrays of varchar and "

was not delivered to:

  laszlo_acs@cms.state.il.us

because:

  User laszlo_acs (laszlo_acs@cms.state.il.us) not listed in public Name & Address Book

I wrote:
> Tim Kane <timk@hotgames.com> writes:
>> I want to insert a number of array elements here...
>> insert into my_table values ('{"value 1", "value 2", "value 3"}');
>> Fine.
>> What do I do however, when I want to insert an array element that
>> contains a " character?

> Hmm.  It looks like array_in tries to deal with backslashed quotes in
> array elements; not sure why it's not working exactly.

Ah, I see ;-)  The correct expression if you want, say, `value "22"a'
in your middle array item is

insert into my_table values ('{"value 1", "value \\"22\\"a", "value 3"}');

You need double backslashes because one level of backslashing will get
stripped off when the lexer handles the string constant '{...}'.
Then what arrives at the array-datatype input converter will be
        {"value 1", "value \"22\"a", "value 3"}
which accomplishes what you want.

There is actually a bug here: when you write it with zero or one
backslashes, the array input converter is presented with
        {"value 1", "value "22"a", "value 3"}
which by all rights should trigger a "malformed array constant"
error message.  But it fails to do so; instead the `"value "22'
part is just dropped on the floor, and the "a" part is taken as
the second array element value.  The input converter should
complain about this input, I think --- though I'm not quite sure
what it should complain about and what it should accept as an
unquoted array element, as in {123.45, 456.66}.  Comments anyone?

                        regards, tom lane

PS: if you want to comment, please reply to the pgsql-sql list,
which seems more appropriate for this issue.

************



Attachment

pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: [INTERFACES] arrays of varchar and "
Next
From: "Moray McConnachie"
Date:
Subject: Re: [SQL] how to create index on timestamp field in pre v7 database