pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
line datatype
16+ messages / 5 participants
[nested] [flat]

* line datatype
@ 2002-07-14 05:09 Tim Hart <tjhart@mac.com>
  2002-07-15 14:43 ` Re: line datatype Bruce Momjian <pgman@candle.pha.pa.us>
  2002-07-16 03:33 ` Re: line datatype Bruce Momjian <pgman@candle.pha.pa.us>
  0 siblings, 2 replies; 16+ messages in thread

From: Tim Hart @ 2002-07-14 05:09 UTC (permalink / raw)
  To: pgsql-sql

Probably the most succinct explanation would be to copy & paste from the 
terminal...

tjhart=> create table a_line( foo line );
CREATE
tjhart=> insert into a_line ( foo ) values( '(0,0), (1,1)' );
ERROR:  line not yet implemented
tjhart=> select version();
                                version
---------------------------------------------------------------------
  PostgreSQL 7.2.1 on powerpc-apple-darwin5.3, compiled by GCC 2.95.2
(1 row)


The documentation (datatype-geometric.html) indicates both a 'line' type 
and an 'lseg' type in the summary table at the top of the page. The same 
code above using the type 'lseg' in place of 'line' works just fine.

Why can I create a table with a column of type 'line' if I can't insert 
into it?




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

* Re: line datatype
  2002-07-14 05:09 line datatype Tim Hart <tjhart@mac.com>
@ 2002-07-15 14:43 ` Bruce Momjian <pgman@candle.pha.pa.us>
  1 sibling, 0 replies; 16+ messages in thread

From: Bruce Momjian @ 2002-07-15 14:43 UTC (permalink / raw)
  To: Tim Hart <tjhart@mac.com>; +Cc: pgsql-sql@postgresql.org, Thomas Lockhart <lockhart@fourpalms.org>

Tim Hart wrote:
> Probably the most succinct explanation would be to copy & paste from the 
> terminal...
> 
> tjhart=> create table a_line( foo line );
> CREATE
> tjhart=> insert into a_line ( foo ) values( '(0,0), (1,1)' );
> ERROR:  line not yet implemented
> tjhart=> select version();
>                                 version
> ---------------------------------------------------------------------
>   PostgreSQL 7.2.1 on powerpc-apple-darwin5.3, compiled by GCC 2.95.2
> (1 row)
> 
> 
> The documentation (datatype-geometric.html) indicates both a 'line' type 
> and an 'lseg' type in the summary table at the top of the page. The same 
> code above using the type 'lseg' in place of 'line' works just fine.
> 
> Why can I create a table with a column of type 'line' if I can't insert 
> into it?

Well, that's a very good question.  I see you have to compile PostgreSQL
with ENABLE_LINE_TYPE defined in pg_config.h.in  and rerun configure.

I see this commit from August 16, 1998:
	
	revision 1.35
	date: 1998/08/16 04:06:55;  author: thomas;  state: Exp;  lines: +7 -6
	Disable not-ready-to-use support code for the line data type.
	Bracket things with #ifdef ENABLE_LINE_TYPE.
	The line data type has always been used internally to support other 
	types, but I/O routines have never been defined for it.

psql \dT clearly shows line and lseg:

 line                        | geometric line '(pt1,pt2)'
 lseg                        | geometric line segment '(pt1,pt2)'

so I think we have both a documentation problem, psql problem, and code
problem.  Let's see what Thomas says.

For the short term, I would use lseg because it looks the same.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026



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

* Re: line datatype
  2002-07-14 05:09 line datatype Tim Hart <tjhart@mac.com>
@ 2002-07-16 03:33 ` Bruce Momjian <pgman@candle.pha.pa.us>
  2002-07-16 06:10   ` Re: [SQL] line datatype Thomas Lockhart <lockhart@fourpalms.org>
  1 sibling, 1 reply; 16+ messages in thread

From: Bruce Momjian @ 2002-07-16 03:33 UTC (permalink / raw)
  To: Tim Hart <tjhart@mac.com>; +Cc: pgsql-sql@postgresql.org, PostgreSQL-development <pgsql-hackers@postgresql.org>


OK, I have added comments to \dT and SGML docs to mention that 'line' is
not implemented.  This should help future folks.

It would be nice to get the line type working 100%.  Thomas says the
problem is input/output format.  I don't completely understand.

---------------------------------------------------------------------------

Tim Hart wrote:
> Probably the most succinct explanation would be to copy & paste from the 
> terminal...
> 
> tjhart=> create table a_line( foo line );
> CREATE
> tjhart=> insert into a_line ( foo ) values( '(0,0), (1,1)' );
> ERROR:  line not yet implemented
> tjhart=> select version();
>                                 version
> ---------------------------------------------------------------------
>   PostgreSQL 7.2.1 on powerpc-apple-darwin5.3, compiled by GCC 2.95.2
> (1 row)
> 
> 
> The documentation (datatype-geometric.html) indicates both a 'line' type 
> and an 'lseg' type in the summary table at the top of the page. The same 
> code above using the type 'lseg' in place of 'line' works just fine.
> 
> Why can I create a table with a column of type 'line' if I can't insert 
> into it?
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026



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

* Re: [SQL] line datatype
  2002-07-14 05:09 line datatype Tim Hart <tjhart@mac.com>
  2002-07-16 03:33 ` Re: line datatype Bruce Momjian <pgman@candle.pha.pa.us>
@ 2002-07-16 06:10   ` Thomas Lockhart <lockhart@fourpalms.org>
  2002-07-16 13:44     ` Re: [SQL] line datatype Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 16+ messages in thread

From: Thomas Lockhart @ 2002-07-16 06:10 UTC (permalink / raw)
  To: Bruce Momjian <pgman@candle.pha.pa.us>; +Cc: Tim Hart <tjhart@mac.com>; PostgreSQL-development <pgsql-hackers@postgresql.org>

> It would be nice to get the line type working 100%.  Thomas says the
> problem is input/output format.  I don't completely understand.

The issue is in choosing an external format for LINE which does not lose
precision during dump/reload. Internally, LINE is described by a formula
which is likely subject to problems with limited precision for some line
orientations.

Does anyone have a suggestion (perhaps drawn from another GIS package)
for representing lines? We already have this implemented internally, and
the algorithms are used to support other data types; the only unresolved
issue is in how to input the values.

                   - Thomas



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

* Re: [SQL] line datatype
  2002-07-14 05:09 line datatype Tim Hart <tjhart@mac.com>
  2002-07-16 03:33 ` Re: line datatype Bruce Momjian <pgman@candle.pha.pa.us>
  2002-07-16 06:10   ` Re: [SQL] line datatype Thomas Lockhart <lockhart@fourpalms.org>
@ 2002-07-16 13:44     ` Tom Lane <tgl@sss.pgh.pa.us>
  2002-07-16 15:21       ` Re: [SQL] line datatype Bruce Momjian <pgman@candle.pha.pa.us>
  0 siblings, 1 reply; 16+ messages in thread

From: Tom Lane @ 2002-07-16 13:44 UTC (permalink / raw)
  To: Thomas Lockhart <lockhart@fourpalms.org>; +Cc: Bruce Momjian <pgman@candle.pha.pa.us>; Tim Hart <tjhart@mac.com>; PostgreSQL-development <pgsql-hackers@postgresql.org>

Thomas Lockhart <lockhart@fourpalms.org> writes:
> The issue is in choosing an external format for LINE which does not lose
> precision during dump/reload.

Why is this any worse for LINE than for any of the other geometric
types (or for plain floats, for that matter)?

We do need a solution for exact dump/reload of floating-point data,
but I don't see why the lack of it should be reason to disable access
to the LINE type.

			regards, tom lane



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

* Re: [SQL] line datatype
  2002-07-14 05:09 line datatype Tim Hart <tjhart@mac.com>
  2002-07-16 03:33 ` Re: line datatype Bruce Momjian <pgman@candle.pha.pa.us>
  2002-07-16 06:10   ` Re: [SQL] line datatype Thomas Lockhart <lockhart@fourpalms.org>
  2002-07-16 13:44     ` Re: [SQL] line datatype Tom Lane <tgl@sss.pgh.pa.us>
@ 2002-07-16 15:21       ` Bruce Momjian <pgman@candle.pha.pa.us>
  2002-07-16 15:29         ` Re: [SQL] line datatype Thomas Lockhart <lockhart@fourpalms.org>
  0 siblings, 1 reply; 16+ messages in thread

From: Bruce Momjian @ 2002-07-16 15:21 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Thomas Lockhart <lockhart@fourpalms.org>; Tim Hart <tjhart@mac.com>; PostgreSQL-development <pgsql-hackers@postgresql.org>

Tom Lane wrote:
> Thomas Lockhart <lockhart@fourpalms.org> writes:
> > The issue is in choosing an external format for LINE which does not lose
> > precision during dump/reload.
> 
> Why is this any worse for LINE than for any of the other geometric
> types (or for plain floats, for that matter)?
> 
> We do need a solution for exact dump/reload of floating-point data,
> but I don't see why the lack of it should be reason to disable access
> to the LINE type.

I don't understand why dumping the two point values isn't sufficient.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026



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

* Re: [SQL] line datatype
  2002-07-14 05:09 line datatype Tim Hart <tjhart@mac.com>
  2002-07-16 03:33 ` Re: line datatype Bruce Momjian <pgman@candle.pha.pa.us>
  2002-07-16 06:10   ` Re: [SQL] line datatype Thomas Lockhart <lockhart@fourpalms.org>
  2002-07-16 13:44     ` Re: [SQL] line datatype Tom Lane <tgl@sss.pgh.pa.us>
  2002-07-16 15:21       ` Re: [SQL] line datatype Bruce Momjian <pgman@candle.pha.pa.us>
@ 2002-07-16 15:29         ` Thomas Lockhart <lockhart@fourpalms.org>
  2002-07-16 15:38           ` Re: [SQL] line datatype Bruce Momjian <pgman@candle.pha.pa.us>
  2002-07-16 16:10           ` Re: [SQL] line datatype Lamar Owen <lamar.owen@wgcr.org>
  0 siblings, 2 replies; 16+ messages in thread

From: Thomas Lockhart @ 2002-07-16 15:29 UTC (permalink / raw)
  To: Bruce Momjian <pgman@candle.pha.pa.us>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Tim Hart <tjhart@mac.com>; PostgreSQL-development <pgsql-hackers@postgresql.org>

...
> > We do need a solution for exact dump/reload of floating-point data,
> > but I don't see why the lack of it should be reason to disable access
> > to the LINE type.
> I don't understand why dumping the two point values isn't sufficient.

Which two point values? LINE is handled as an equation, not as points,
unlike the LSEG type which has two points.

One possibility is to have the external representation *be* the same as
LSEG, then convert internally. Then we need to decide how to scale those
points; maybe always using a unit vector is the right thing to do...

                     - Thomas



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

* Re: [SQL] line datatype
  2002-07-14 05:09 line datatype Tim Hart <tjhart@mac.com>
  2002-07-16 03:33 ` Re: line datatype Bruce Momjian <pgman@candle.pha.pa.us>
  2002-07-16 06:10   ` Re: [SQL] line datatype Thomas Lockhart <lockhart@fourpalms.org>
  2002-07-16 13:44     ` Re: [SQL] line datatype Tom Lane <tgl@sss.pgh.pa.us>
  2002-07-16 15:21       ` Re: [SQL] line datatype Bruce Momjian <pgman@candle.pha.pa.us>
  2002-07-16 15:29         ` Re: [SQL] line datatype Thomas Lockhart <lockhart@fourpalms.org>
@ 2002-07-16 15:38           ` Bruce Momjian <pgman@candle.pha.pa.us>
  2002-07-16 16:07             ` Re: [SQL] line datatype Thomas Lockhart <lockhart@fourpalms.org>
  1 sibling, 1 reply; 16+ messages in thread

From: Bruce Momjian @ 2002-07-16 15:38 UTC (permalink / raw)
  To: Thomas Lockhart <lockhart@fourpalms.org>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Tim Hart <tjhart@mac.com>; PostgreSQL-development <pgsql-hackers@postgresql.org>

Thomas Lockhart wrote:
> ...
> > > We do need a solution for exact dump/reload of floating-point data,
> > > but I don't see why the lack of it should be reason to disable access
> > > to the LINE type.
> > I don't understand why dumping the two point values isn't sufficient.
> 
> Which two point values? LINE is handled as an equation, not as points,
> unlike the LSEG type which has two points.

Well, the \dT documentation used to show line as two points, so I
assumed that was how it was specified.

> One possibility is to have the external representation *be* the same as
> LSEG, then convert internally. Then we need to decide how to scale those
> points; maybe always using a unit vector is the right thing to do...

No one likes entering an equation.  Two points seems the simplest.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026



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

* Re: [SQL] line datatype
  2002-07-14 05:09 line datatype Tim Hart <tjhart@mac.com>
  2002-07-16 03:33 ` Re: line datatype Bruce Momjian <pgman@candle.pha.pa.us>
  2002-07-16 06:10   ` Re: [SQL] line datatype Thomas Lockhart <lockhart@fourpalms.org>
  2002-07-16 13:44     ` Re: [SQL] line datatype Tom Lane <tgl@sss.pgh.pa.us>
  2002-07-16 15:21       ` Re: [SQL] line datatype Bruce Momjian <pgman@candle.pha.pa.us>
  2002-07-16 15:29         ` Re: [SQL] line datatype Thomas Lockhart <lockhart@fourpalms.org>
  2002-07-16 15:38           ` Re: [SQL] line datatype Bruce Momjian <pgman@candle.pha.pa.us>
@ 2002-07-16 16:07             ` Thomas Lockhart <lockhart@fourpalms.org>
  2002-07-16 16:30               ` Re: [SQL] line datatype Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 16+ messages in thread

From: Thomas Lockhart @ 2002-07-16 16:07 UTC (permalink / raw)
  To: Bruce Momjian <pgman@candle.pha.pa.us>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Tim Hart <tjhart@mac.com>; PostgreSQL-development <pgsql-hackers@postgresql.org>

...
> Well, the \dT documentation used to show line as two points, so I
> assumed that was how it was specified.

Hmm. And it seems I entered it a few years ago ;)

Cut and paste error. At that time the line type was defined but has
never had the i/o routines enabled.

> No one likes entering an equation.  Two points seems the simplest.

That it does.

                     - Thomas



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

* Re: [SQL] line datatype
  2002-07-14 05:09 line datatype Tim Hart <tjhart@mac.com>
  2002-07-16 03:33 ` Re: line datatype Bruce Momjian <pgman@candle.pha.pa.us>
  2002-07-16 06:10   ` Re: [SQL] line datatype Thomas Lockhart <lockhart@fourpalms.org>
  2002-07-16 13:44     ` Re: [SQL] line datatype Tom Lane <tgl@sss.pgh.pa.us>
  2002-07-16 15:21       ` Re: [SQL] line datatype Bruce Momjian <pgman@candle.pha.pa.us>
  2002-07-16 15:29         ` Re: [SQL] line datatype Thomas Lockhart <lockhart@fourpalms.org>
  2002-07-16 15:38           ` Re: [SQL] line datatype Bruce Momjian <pgman@candle.pha.pa.us>
  2002-07-16 16:07             ` Re: [SQL] line datatype Thomas Lockhart <lockhart@fourpalms.org>
@ 2002-07-16 16:30               ` Tom Lane <tgl@sss.pgh.pa.us>
  2002-07-16 16:31                 ` Re: [SQL] line datatype Bruce Momjian <pgman@candle.pha.pa.us>
  2002-07-16 20:42                 ` Re: [SQL] line datatype Thomas Lockhart <lockhart@fourpalms.org>
  0 siblings, 2 replies; 16+ messages in thread

From: Tom Lane @ 2002-07-16 16:30 UTC (permalink / raw)
  To: Thomas Lockhart <lockhart@fourpalms.org>; +Cc: Bruce Momjian <pgman@candle.pha.pa.us>; Tim Hart <tjhart@mac.com>; PostgreSQL-development <pgsql-hackers@postgresql.org>

Thomas Lockhart <lockhart@fourpalms.org> writes:
>> No one likes entering an equation.  Two points seems the simplest.

> That it does.

On the other hand, if you want to enter two points why don't you just
use lseg to begin with?  There's not much justification for having a
separate line type unless it behaves differently ...

			regards, tom lane



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

* Re: [SQL] line datatype
  2002-07-14 05:09 line datatype Tim Hart <tjhart@mac.com>
  2002-07-16 03:33 ` Re: line datatype Bruce Momjian <pgman@candle.pha.pa.us>
  2002-07-16 06:10   ` Re: [SQL] line datatype Thomas Lockhart <lockhart@fourpalms.org>
  2002-07-16 13:44     ` Re: [SQL] line datatype Tom Lane <tgl@sss.pgh.pa.us>
  2002-07-16 15:21       ` Re: [SQL] line datatype Bruce Momjian <pgman@candle.pha.pa.us>
  2002-07-16 15:29         ` Re: [SQL] line datatype Thomas Lockhart <lockhart@fourpalms.org>
  2002-07-16 15:38           ` Re: [SQL] line datatype Bruce Momjian <pgman@candle.pha.pa.us>
  2002-07-16 16:07             ` Re: [SQL] line datatype Thomas Lockhart <lockhart@fourpalms.org>
  2002-07-16 16:30               ` Re: [SQL] line datatype Tom Lane <tgl@sss.pgh.pa.us>
@ 2002-07-16 16:31                 ` Bruce Momjian <pgman@candle.pha.pa.us>
  1 sibling, 0 replies; 16+ messages in thread

From: Bruce Momjian @ 2002-07-16 16:31 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Thomas Lockhart <lockhart@fourpalms.org>; Tim Hart <tjhart@mac.com>; PostgreSQL-development <pgsql-hackers@postgresql.org>

Tom Lane wrote:
> Thomas Lockhart <lockhart@fourpalms.org> writes:
> >> No one likes entering an equation.  Two points seems the simplest.
> 
> > That it does.
> 
> On the other hand, if you want to enter two points why don't you just
> use lseg to begin with?  There's not much justification for having a
> separate line type unless it behaves differently ...

I assume the line type keeps going after the two end points, while lseg
doesn't.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026



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

* Re: [SQL] line datatype
  2002-07-14 05:09 line datatype Tim Hart <tjhart@mac.com>
  2002-07-16 03:33 ` Re: line datatype Bruce Momjian <pgman@candle.pha.pa.us>
  2002-07-16 06:10   ` Re: [SQL] line datatype Thomas Lockhart <lockhart@fourpalms.org>
  2002-07-16 13:44     ` Re: [SQL] line datatype Tom Lane <tgl@sss.pgh.pa.us>
  2002-07-16 15:21       ` Re: [SQL] line datatype Bruce Momjian <pgman@candle.pha.pa.us>
  2002-07-16 15:29         ` Re: [SQL] line datatype Thomas Lockhart <lockhart@fourpalms.org>
  2002-07-16 15:38           ` Re: [SQL] line datatype Bruce Momjian <pgman@candle.pha.pa.us>
  2002-07-16 16:07             ` Re: [SQL] line datatype Thomas Lockhart <lockhart@fourpalms.org>
  2002-07-16 16:30               ` Re: [SQL] line datatype Tom Lane <tgl@sss.pgh.pa.us>
@ 2002-07-16 20:42                 ` Thomas Lockhart <lockhart@fourpalms.org>
  2002-07-16 20:46                   ` Re: [SQL] line datatype Lamar Owen <lamar.owen@wgcr.org>
  1 sibling, 1 reply; 16+ messages in thread

From: Thomas Lockhart @ 2002-07-16 20:42 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Bruce Momjian <pgman@candle.pha.pa.us>; Tim Hart <tjhart@mac.com>; PostgreSQL-development <pgsql-hackers@postgresql.org>

> >> No one likes entering an equation.  Two points seems the simplest.
> > That it does.
> On the other hand, if you want to enter two points why don't you just
> use lseg to begin with?  There's not much justification for having a
> separate line type unless it behaves differently ...

They are different. One is infinite in length, the other is finite.
Distances, etc are calculated differently between the two types.

                  - Thomas



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

* Re: [SQL] line datatype
  2002-07-14 05:09 line datatype Tim Hart <tjhart@mac.com>
  2002-07-16 03:33 ` Re: line datatype Bruce Momjian <pgman@candle.pha.pa.us>
  2002-07-16 06:10   ` Re: [SQL] line datatype Thomas Lockhart <lockhart@fourpalms.org>
  2002-07-16 13:44     ` Re: [SQL] line datatype Tom Lane <tgl@sss.pgh.pa.us>
  2002-07-16 15:21       ` Re: [SQL] line datatype Bruce Momjian <pgman@candle.pha.pa.us>
  2002-07-16 15:29         ` Re: [SQL] line datatype Thomas Lockhart <lockhart@fourpalms.org>
  2002-07-16 15:38           ` Re: [SQL] line datatype Bruce Momjian <pgman@candle.pha.pa.us>
  2002-07-16 16:07             ` Re: [SQL] line datatype Thomas Lockhart <lockhart@fourpalms.org>
  2002-07-16 16:30               ` Re: [SQL] line datatype Tom Lane <tgl@sss.pgh.pa.us>
  2002-07-16 20:42                 ` Re: [SQL] line datatype Thomas Lockhart <lockhart@fourpalms.org>
@ 2002-07-16 20:46                   ` Lamar Owen <lamar.owen@wgcr.org>
  0 siblings, 0 replies; 16+ messages in thread

From: Lamar Owen @ 2002-07-16 20:46 UTC (permalink / raw)
  To: Thomas Lockhart <lockhart@fourpalms.org>; Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Bruce Momjian <pgman@candle.pha.pa.us>; Tim Hart <tjhart@mac.com>; PostgreSQL-development <pgsql-hackers@postgresql.org>

On Tuesday 16 July 2002 04:42 pm, Thomas Lockhart wrote:
> > On the other hand, if you want to enter two points why don't you just
> > use lseg to begin with?  There's not much justification for having a
> > separate line type unless it behaves differently ...

> They are different. One is infinite in length, the other is finite.
> Distances, etc are calculated differently between the two types.

For some of my work a type of 'ray' would be nice... :-) But LSEG's usually 
work OK as long as you specify an endpoint that is far enough away.
-- 
Lamar Owen
WGCR Internet Radio
1 Peter 4:11



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

* Re: [SQL] line datatype
  2002-07-14 05:09 line datatype Tim Hart <tjhart@mac.com>
  2002-07-16 03:33 ` Re: line datatype Bruce Momjian <pgman@candle.pha.pa.us>
  2002-07-16 06:10   ` Re: [SQL] line datatype Thomas Lockhart <lockhart@fourpalms.org>
  2002-07-16 13:44     ` Re: [SQL] line datatype Tom Lane <tgl@sss.pgh.pa.us>
  2002-07-16 15:21       ` Re: [SQL] line datatype Bruce Momjian <pgman@candle.pha.pa.us>
  2002-07-16 15:29         ` Re: [SQL] line datatype Thomas Lockhart <lockhart@fourpalms.org>
@ 2002-07-16 16:10           ` Lamar Owen <lamar.owen@wgcr.org>
  2002-07-16 16:26             ` Re: [SQL] line datatype Bruce Momjian <pgman@candle.pha.pa.us>
  1 sibling, 1 reply; 16+ messages in thread

From: Lamar Owen @ 2002-07-16 16:10 UTC (permalink / raw)
  To: Thomas Lockhart <lockhart@fourpalms.org>; Bruce Momjian <pgman@candle.pha.pa.us>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Tim Hart <tjhart@mac.com>; PostgreSQL-development <pgsql-hackers@postgresql.org>

On Tuesday 16 July 2002 11:29 am, Thomas Lockhart wrote:
> > > We do need a solution for exact dump/reload of floating-point data,
> > > but I don't see why the lack of it should be reason to disable access
> > > to the LINE type.

> > I don't understand why dumping the two point values isn't sufficient.

> Which two point values? LINE is handled as an equation, not as points,
> unlike the LSEG type which has two points.

> One possibility is to have the external representation *be* the same as
> LSEG, then convert internally. Then we need to decide how to scale those
> points; maybe always using a unit vector is the right thing to do...

Lines are entered now by specifying two points, anywhere on the line, right?  
The internal representation is then slope-intercept?  Why not allow either 
the 'two-point' entry, or direct entry as slope-intercept?  How do we 
represent lines now in output?  Do we pick two arbitrary points on the line?  
If so, I can see Thomas' point here, where the original data entry might have 
specified two relatively distant points -- but then there's a precision error 
anyway converting to slope-intercept, if indeed that is the internal 
representation.  So why not dump in slope-intercept form, if that is the 
internal representation?

But, you're telling me floats aren't dumpable/restoreable to exactly the same 
value?  (????)  This can't be good.
-- 
Lamar Owen
WGCR Internet Radio
1 Peter 4:11



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

* Re: [SQL] line datatype
  2002-07-14 05:09 line datatype Tim Hart <tjhart@mac.com>
  2002-07-16 03:33 ` Re: line datatype Bruce Momjian <pgman@candle.pha.pa.us>
  2002-07-16 06:10   ` Re: [SQL] line datatype Thomas Lockhart <lockhart@fourpalms.org>
  2002-07-16 13:44     ` Re: [SQL] line datatype Tom Lane <tgl@sss.pgh.pa.us>
  2002-07-16 15:21       ` Re: [SQL] line datatype Bruce Momjian <pgman@candle.pha.pa.us>
  2002-07-16 15:29         ` Re: [SQL] line datatype Thomas Lockhart <lockhart@fourpalms.org>
  2002-07-16 16:10           ` Re: [SQL] line datatype Lamar Owen <lamar.owen@wgcr.org>
@ 2002-07-16 16:26             ` Bruce Momjian <pgman@candle.pha.pa.us>
  0 siblings, 0 replies; 16+ messages in thread

From: Bruce Momjian @ 2002-07-16 16:26 UTC (permalink / raw)
  To: Lamar Owen <lamar.owen@wgcr.org>; +Cc: Thomas Lockhart <lockhart@fourpalms.org>; Tom Lane <tgl@sss.pgh.pa.us>; Tim Hart <tjhart@mac.com>; PostgreSQL-development <pgsql-hackers@postgresql.org>

Lamar Owen wrote:
> On Tuesday 16 July 2002 11:29 am, Thomas Lockhart wrote:
> > > > We do need a solution for exact dump/reload of floating-point data,
> > > > but I don't see why the lack of it should be reason to disable access
> > > > to the LINE type.
> 
> > > I don't understand why dumping the two point values isn't sufficient.
> 
> > Which two point values? LINE is handled as an equation, not as points,
> > unlike the LSEG type which has two points.
> 
> > One possibility is to have the external representation *be* the same as
> > LSEG, then convert internally. Then we need to decide how to scale those
> > points; maybe always using a unit vector is the right thing to do...
> 
> Lines are entered now by specifying two points, anywhere on the line, right?  
> The internal representation is then slope-intercept?  Why not allow either 
> the 'two-point' entry, or direct entry as slope-intercept?  How do we 
> represent lines now in output?  Do we pick two arbitrary points on the line?  
> If so, I can see Thomas' point here, where the original data entry might have 
> specified two relatively distant points -- but then there's a precision error 
> anyway converting to slope-intercept, if indeed that is the internal 
> representation.  So why not dump in slope-intercept form, if that is the 
> internal representation?

Yow, I can see the pain of having slope/intercept and trying to output
two points.  What if we store line internally as two points, and convert
to slope/intercept when needed.  That way, it would dump out just as it
was entered.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026



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

* Fwd: line datatype
@ 2002-07-15 03:32 Tim Hart <tjhart@mac.com>
  0 siblings, 0 replies; 16+ messages in thread

From: Tim Hart @ 2002-07-15 03:32 UTC (permalink / raw)
  To: pgsql-sql

Probably the most succinct explanation would be to copy & paste from the 
terminal...

tjhart=> create table a_line( foo line );
CREATE
tjhart=> insert into a_line ( foo ) values( '(0,0), (1,1)' );
ERROR:  line not yet implemented
tjhart=> select version();
                                version
---------------------------------------------------------------------
  PostgreSQL 7.2.1 on powerpc-apple-darwin5.3, compiled by GCC 2.95.2
(1 row)


The documentation (datatype-geometric.html) indicates both a 'line' type 
and an 'lseg' type in the summary table at the top of the page. The same 
code above using the type 'lseg' in place of 'line' works just fine.

Why can I create a table with a column of type 'line' if I can't insert 
into it?




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


end of thread, other threads:[~2002-07-16 20:46 UTC | newest]

Thread overview: 16+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-07-14 05:09 line datatype Tim Hart <tjhart@mac.com>
2002-07-15 14:43 ` Bruce Momjian <pgman@candle.pha.pa.us>
2002-07-16 03:33 ` Bruce Momjian <pgman@candle.pha.pa.us>
2002-07-16 06:10   ` Thomas Lockhart <lockhart@fourpalms.org>
2002-07-16 13:44     ` Tom Lane <tgl@sss.pgh.pa.us>
2002-07-16 15:21       ` Bruce Momjian <pgman@candle.pha.pa.us>
2002-07-16 15:29         ` Thomas Lockhart <lockhart@fourpalms.org>
2002-07-16 15:38           ` Bruce Momjian <pgman@candle.pha.pa.us>
2002-07-16 16:07             ` Thomas Lockhart <lockhart@fourpalms.org>
2002-07-16 16:30               ` Tom Lane <tgl@sss.pgh.pa.us>
2002-07-16 16:31                 ` Bruce Momjian <pgman@candle.pha.pa.us>
2002-07-16 20:42                 ` Thomas Lockhart <lockhart@fourpalms.org>
2002-07-16 20:46                   ` Lamar Owen <lamar.owen@wgcr.org>
2002-07-16 16:10           ` Lamar Owen <lamar.owen@wgcr.org>
2002-07-16 16:26             ` Bruce Momjian <pgman@candle.pha.pa.us>
2002-07-15 03:32 Fwd: line datatype Tim Hart <tjhart@mac.com>

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