Re: quoting psql varible as identifier - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: quoting psql varible as identifier
Date
Msg-id 162867791001041151w62505b29gfce580ec114220af@mail.gmail.com
Whole thread Raw
In response to Re: quoting psql varible as identifier  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: quoting psql varible as identifier  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
2010/1/4 Tom Lane <tgl@sss.pgh.pa.us>:
> Pavel Stehule <pavel.stehule@gmail.com> writes:
>> I have one question. If I understand well, the function fmtId isn't
>> multibyte safe? So why is possible to use it in pg_dump?
>
> pg_dump is only guaranteed to work correctly in the server encoding.
> If you force it to use a client_encoding different from the server's,
> it might or might not work, for reasons far beyond that one --- the
> big problem usually is data containing characters that have no
> equivalent in the client encoding.  So I'm not particularly excited
> about whether fmtId is multibyte safe within pg_dump.  If we were to try
> to use it in more general contexts, it would probably need more work.

I could agree with this explanation for quote_identifier function, but
not in 100% for fmtId function. We can change encoding for pg_dump
(option -E). I don't have a problem to write second and safe fmtId
function (with technique used in dumputils don't need to modify
libpq), although fmtId do exactly what I need. I would to understand
to behave.

Pavel


>
>                        regards, tom lane
>


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: I: TODO: Allow substring/replace() to get/set bit values
Next
From: Bruce Momjian
Date:
Subject: Re: pg_migrator issues