pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
open and closed paths ...
4+ messages / 2 participants
[nested] [flat]

* open and closed paths ...
@ 2001-04-08 13:59 Hans-Jürgen Schönig <hs@cybertec.at>
  2001-04-08 21:15 ` Re: open and closed paths ... Peter Eisentraut <peter_e@gmx.net>
  0 siblings, 1 reply; 4+ messages in thread

From: Hans-Jürgen Schönig @ 2001-04-08 13:59 UTC (permalink / raw)
  To: pgsql-sql

I am using PostgreSQL 7.0.3. I have tried the isopen() function but it
doesn't seem to work (or it is not fully implemented yet).
In my opinion the third record is a closed path but the isopen()
functions return f.
Have I done something wrong, have I got something wrong or is it a bug?

    Hans



shop=# SELECT * FROM temppath;
      fieldname
----------------------
 ((1,3),(4,12))
 ((3,1),(2,8),(10,4))
 ((3,1),(2,8),(3,1))
 ((1,1),(2,2),(3,3))
(4 rows)

shop=# INSERT INTO temppath(fieldname) VALUES ('(1,1), (2,3)');
INSERT 51857 1
shop=# SELECT isopen(fieldname) FROM temppath;
 isopen
--------
 f
 f
 f
 f
 f
(5 rows)





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: open and closed paths ...
  2001-04-08 13:59 open and closed paths ... Hans-Jürgen Schönig <hs@cybertec.at>
@ 2001-04-08 21:15 ` Peter Eisentraut <peter_e@gmx.net>
  2001-04-09 08:02   ` Re: open and closed paths ... Hans-Jürgen Schönig <hs@cybertec.at>
  0 siblings, 1 reply; 4+ messages in thread

From: Peter Eisentraut @ 2001-04-08 21:15 UTC (permalink / raw)
  To: Hans-Jürgen Schönig <hs@cybertec.at>; +Cc: pgsql-sql

Hans-Jürgen Schönig writes:

> I am using PostgreSQL 7.0.3. I have tried the isopen() function but it
> doesn't seem to work (or it is not fully implemented yet).
> In my opinion the third record is a closed path but the isopen()
> functions return f.

For no good reason apart from ancient tradition, paths enclosed in
parentheses, like ((3,1),(2,8),(10,4)), are implicitly closed.  To make an
open path brackets should be used, like [(3,1),(2,8),(10,4)].

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




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: open and closed paths ...
  2001-04-08 13:59 open and closed paths ... Hans-Jürgen Schönig <hs@cybertec.at>
  2001-04-08 21:15 ` Re: open and closed paths ... Peter Eisentraut <peter_e@gmx.net>
@ 2001-04-09 08:02   ` Hans-Jürgen Schönig <hs@cybertec.at>
  2001-04-09 16:55     ` Re: Re: open and closed paths ... Peter Eisentraut <peter_e@gmx.net>
  0 siblings, 1 reply; 4+ messages in thread

From: Hans-Jürgen Schönig @ 2001-04-09 08:02 UTC (permalink / raw)
  To: pgsql-sql

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 "'"
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 "["

shop=# SELECT isopen(fieldname) FROM temppath;
 isopen
--------
 f
(1 row)







^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Re: open and closed paths ...
  2001-04-08 13:59 open and closed paths ... Hans-Jürgen Schönig <hs@cybertec.at>
  2001-04-08 21:15 ` Re: open and closed paths ... Peter Eisentraut <peter_e@gmx.net>
  2001-04-09 08:02   ` Re: open and closed paths ... Hans-Jürgen Schönig <hs@cybertec.at>
@ 2001-04-09 16:55     ` Peter Eisentraut <peter_e@gmx.net>
  0 siblings, 0 replies; 4+ messages in thread

From: Peter Eisentraut @ 2001-04-09 16:55 UTC (permalink / raw)
  To: Hans-Jürgen Schönig <hs@cybertec.at>; +Cc: 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/




^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2001-04-09 16:55 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-04-08 13:59 open and closed paths ... Hans-Jürgen Schönig <hs@cybertec.at>
2001-04-08 21:15 ` Peter Eisentraut <peter_e@gmx.net>
2001-04-09 08:02   ` Hans-Jürgen Schönig <hs@cybertec.at>
2001-04-09 16:55     ` Peter Eisentraut <peter_e@gmx.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox