Re: Re: open and closed paths ... - Mailing list pgsql-sql

From Peter Eisentraut
Subject Re: Re: open and closed paths ...
Date
Msg-id Pine.LNX.4.30.0104091853520.1255-100000@peter.localdomain
Whole thread Raw
In response to Re: open and closed paths ...  (Hans-Jürgen Schönig <hs@cybertec.at>)
List pgsql-sql
Hans-Jürgen Schönig writes:

> The only problem left is the correct syntax of the command when using [].
> I've tried some versions but it did not work.
> Maybe Tom can include an example into the docs.
>
>     Hans
>
>
> shop=# INSERT INTO temppath(fieldname) VALUES '((1,3), (4,12))';
> ERROR:  parser: parse error at or near "'"

Should be VALUES ('((1,3), (4,12))');  The outer parentheses belong to the
INSERT command, the quotes delimit the data literal, whatever is inside
the quotes is the data type's business.

> shop=# INSERT INTO temppath(fieldname) VALUES ((1,3), (4,12));
> ERROR:  parser: parse error at or near ","
> shop=# INSERT INTO temppath(fieldname) VALUES ('(1,3), (4,12)');
> INSERT 51947 1
> shop=# INSERT INTO temppath(fieldname) VALUES ['(1,3), (4,12)'];
> ERROR:  parser: parse error at or near "["
> shop=# INSERT INTO temppath(fieldname) VALUES '[(1,3), (4,12)]';
> ERROR:  parser: parse error at or near "'"
> shop=# INSERT INTO temppath(fieldname) VALUES '[(1,3), (4,12)]'::path;
> ERROR:  parser: parse error at or near "'"
> shop=# INSERT INTO temppath(fieldname) VALUES ['(1,3), (4,12)']::path;
> ERROR:  parser: parse error at or near "["

-- 
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/



pgsql-sql by date:

Previous
From: "Ross J. Reedstrom"
Date:
Subject: Re: Casting numeric to text
Next
From: Peter Eisentraut
Date:
Subject: Re: Casting numeric to text