Re: Unexpected behaviour of encode() - Mailing list pgsql-general

From Merlin Moncure
Subject Re: Unexpected behaviour of encode()
Date
Msg-id CAHyXU0z2b1RGaUwJxhJ_znWCZkNQo=6ht2qB1zjyd3ekc_UatA@mail.gmail.com
Whole thread Raw
In response to Unexpected behaviour of encode()  (Bill Moran <wmoran@potentialtech.com>)
Responses Re: Unexpected behaviour of encode()
List pgsql-general
On Tue, Mar 26, 2013 at 12:47 PM, Bill Moran <wmoran@potentialtech.com> wrote:
>
> psql -U postgres
> psql (9.2.3)
> Type "help" for help.
>
> postgres=# select encode('can''t', 'escape');
>  encode
> --------
>  can't
> (1 row)
>
> I observed the same behaviour on one of our older systems (8.3.11) as well.
>
> Am I missing something?  I expected "can''t" as the output.

why? that isn't what you passed it.  the input string doubled single
quotes is converted to single single quote per spec.  it's 'ghetto
escaping'.

merlin


pgsql-general by date:

Previous
From: Bill Moran
Date:
Subject: Unexpected behaviour of encode()
Next
From: Kevin Grittner
Date:
Subject: Re: pg_stat_get_last_vacuum_time(): why non-FULL?