Re: ARRAY[] with \'s is broken?

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Rod Taylor <pg(at)rbt(dot)ca>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ARRAY[] with \'s is broken?
Date: 2005-05-17 17:18:03
Message-ID: 428A274B.7080209@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


I don't see anything broken. V 7.4.8 shows the same:

andrew=# select ARRAY['\\a'] as f1, ARRAY['\a']as f2 , ARRAY['\\\a'] as f2;

f1 | f2 | f2

--------+-----+---------

{"\\a"} | {a} | {"\\a"}

It might be mildly confusing because '\a' == 'a'

cheers

andrew

Rod Taylor wrote:

>Can anyone explain what's going on with the slashes?
>
>ssdb=# select version();
> version
>---------------------------------------------------------------------------
> PostgreSQL 8.0.1 on sparc-sun-solaris2.9, compiled by GCC gcc (GCC)
>3.4.2
>(1 row)
>
>ssdb=# select ARRAY['\\a'];
> array
>---------
> {"\\a"}
>(1 row)
>
>ssdb=# select ARRAY['\a'];
> array
>-------
> {a}
>(1 row)
>
>ssdb=# select ARRAY['\\\a'];
> array
>---------
> {"\\a"}
>(1 row)
>
>
>
>
>
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Rod Taylor 2005-05-17 17:19:59 Re: ARRAY[] with \'s is broken?
Previous Message Kris Jurka 2005-05-17 17:15:25 Re: Cost of XLogInsert CRC calculations