Re: point -> double,double ? - Mailing list pgsql-general

From Tom Lane
Subject Re: point -> double,double ?
Date
Msg-id 21148.1042862575@sss.pgh.pa.us
Whole thread Raw
In response to Re: point -> double,double ?  (Greg Stark <gsstark@mit.edu>)
Responses Re: point -> double,double ?
List pgsql-general
Greg Stark <gsstark@mit.edu> writes:
> Hm, this seems odd

> slo=> select b,b[0],b[0][0] from t;
>                        b                       |           b            | b
> -----------------------------------------------+------------------------+---
>  (-75.493906,44.854114),(-75.493906,44.854114) | (-75.493906,44.854114) |
> (1 row)

The problem here is that foo[m][n] is our notation for a
doubly-subscripted array --- and we don't have any concept in the type
system that a one-dimensional array is different from a two-dimensional
array.  So the code goes down the primrose path of assuming that "b"
is a 2-D array of points, rather than expecting b[0] to yield a
separate datatype that should be separately subscripted.

We could perhaps hack something for this particular case, since box is
known not to be a general array but only a hardwired one-dimensional
array of points.  I don't see a good general solution though.
Any thoughts?

            regards, tom lane

pgsql-general by date:

Previous
From: "kanchana"
Date:
Subject: Re: Fw: configure error with krb5
Next
From: Tom Lane
Date:
Subject: Re: Fw: configure error with krb5