Re: postgres 9.2 error whit apostrophes

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: postgres 9.2 error whit apostrophes
Дата
Msg-id CAOR=d=3PDv-eBU7GCS9y6CWgRGT7_2nzHdAaQLrngFpV==wftQ@mail.gmail.com
обсуждение исходный текст
Ответ на postgres 9.2 error whit apostrophes  (Alejandro Brust <alejandrob@pasteleros.org.ar>)
Ответы Re: postgres 9.2 error whit apostrophes  (Alejandro Brust <alejandrob@pasteleros.org.ar>)
Список pgsql-admin
On Tue, Jun 11, 2013 at 2:57 PM, Alejandro Brust
<alejandrob@pasteleros.org.ar> wrote:
> Hello, excuse my English first
>
> we recently move from pg9.0 to pg 9.2 whit this method:
>
> from a new server PG9.2 we did:
> pg_dump -h server -p 5432 -U user -Fc -i -b base-name > bk.backup
>
> after that in the new server
> createdb -T template0 -E LATIN1 basename
> pg_restore -h server -p 5432 -U user -d basename bk.backup
>
> now we are having problems with updates on tables  whit apostrophes like  >>
> o'higgins << on any character fields
> First question:
>             is there  any configurable parameter for PG9.2 that make
>             update tu02t00 set tu02pfusua = 'D'AGOSTINO'  work...
>             the server error said
>
> ERROR: syntax error at or near "AGOSTINO" at character 187
>
> Second question:
> If there is no way to configure PG9.2 to accept this Cain of update
> which is the best method to do a downgrade from 9.2 to 9.0 (we are not using
> any new function)

That shouldn't work in any version of postgresql.

Two ways to insert that.

1: escape it:
update tu02t00 set tu02pfusua = 'D''AGOSTINO' ...

2: Use $$ quotes:

update tu02t00 set tu02pfusua = $$D'AGOSTINO$$ ...


В списке pgsql-admin по дате отправления:

Предыдущее
От: Alejandro Brust
Дата:
Сообщение: postgres 9.2 error whit apostrophes
Следующее
От: Alejandro Brust
Дата:
Сообщение: Re: postgres 9.2 error whit apostrophes