pg.ddx.io  pgsql-rrreviewers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Smith <greg@2ndQuadrant.com>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: [PATCH] Revive line type
Date: Mon, 22 Jul 2013 21:36:00 -0400
Message-ID: <51EDDE00.6040308@2ndQuadrant.com> (raw)
In-Reply-To: <1372296877.5915.5.camel@vanquo.pezone.net>
References: <CAHfbbWvgj-VfqW00uSKFW=r6KbvMhfaH71OQRmmU0c+2YFtQ8Q@mail.gmail.com>
	<1372296877.5915.5.camel@vanquo.pezone.net>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

On 6/26/13 9:34 PM, Peter Eisentraut wrote:
> Still wondering whether to use a A,B,C-based output
> format per Tom's comment.

Wouldn't it also be helpful to remove "The points used in the output are 
not necessarily the points used on input" by making that not true?

There are three obvious ways you might output a line:

-Math class expectations of slope-intercept form:  y = mx + b. 
Intercept forms don't handle both horizontal and vertical lines though, 
so that's easily out.

-Pair of points.  A casual observer might get lucky and observe putting 
a pair of points in and getting the same pair back again, then 
incorrectly assume that's normally the case.  Seems better to never make 
that possible in the infinite line case.  I'm reminded of how row output 
usually is in order gives a bad impression about ordering guarantees in SQL.

-Ax+By+C=0

Outputting that third one, when it's also the internal form, handles any 
time of line; will show any assumptions about individual points being 
preserved are wrong; and avoids rounding errors too.  The only downside 
seems to be that bounded lines are easier to show with a pair of points. 
  I think that suggests an alternate, secondary output format would be 
useful though, rather than that a different default one is a good idea.

-- 
Greg Smith   2ndQuadrant US    greg@2ndQuadrant.com   Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.com


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (8+ messages)  latest in thread

Message-ID: <51EDDE00.6040308@2ndQuadrant.com>
Permalink:  ../51EDDE00.6040308@2ndQuadrant.com/
Also on:    postgresql.org/message-id/51EDDE00.6040308@2ndQuadrant.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-rrreviewers@postgresql.org
  Cc: greg@2ndQuadrant.com, peter_e@gmx.net, pgsql-hackers@postgresql.org
  Subject: Re: [PATCH] Revive line type
  In-Reply-To: <51EDDE00.6040308@2ndQuadrant.com>
  References: <CAHfbbWvgj-VfqW00uSKFW=r6KbvMhfaH71OQRmmU0c+2YFtQ8Q@mail.gmail.com> <1372296877.5915.5.camel@vanquo.pezone.net> <51EDDE00.6040308@2ndQuadrant.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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