Re: quoting bug? - Mailing list pgsql-hackers

From Brendan Jurd
Subject Re: quoting bug?
Date
Msg-id 37ed240d0802090912l638de73dj9315c7a7dca2c8c5@mail.gmail.com
Whole thread Raw
In response to quoting bug?  (Patrick Welche <prlw1@newn.cam.ac.uk>)
List pgsql-hackers
On Feb 10, 2008 3:50 AM, Patrick Welche <prlw1@newn.cam.ac.uk> wrote:
> NOTICE:  (1,two,"Sat 09 Feb 16:47:44.514503 2008")
> INSERT 0 0
>

I think what you're seeing is the syntax for row literals.

You can get an idea of how it looks without having to write trigger
functions, e.g.:

> select row(1, 'second value', current_timestamp);               row
-----------------------------------(1,"second value","2008-02-10 04:00:54.458647+11")
(1 row)

Note that anything which includes spaces, commas or brackets is double-quoted.

You can see it working the other way around by constructing a record
using the literal syntax.

=> create type foo as (a text, b int);
CREATE TYPE
=> select '("one", 2)'::foo;  foo
---------(one,2)
(1 row)

Cheers,
BJ


pgsql-hackers by date:

Previous
From: Patrick Welche
Date:
Subject: quoting bug?
Next
From: Tom Lane
Date:
Subject: Re: Patch review