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/