Re: How do I create an array? - Mailing list pgsql-general

From Tom Lane
Subject Re: How do I create an array?
Date
Msg-id 9474.1044509071@sss.pgh.pa.us
Whole thread Raw
In response to How do I create an array?  (Greg Stark <gsstark@mit.edu>)
Responses Re: How do I create an array?  (Joe Conway <mail@joeconway.com>)
List pgsql-general
Greg Stark <gsstark@mit.edu> writes:
> There must be something like the point() function for arrays, no?

Not in general --- how would you declare the input and result types
of such a function?  Unless you make a bespoke function for every
array-element datatype, there's no evident way to declare it in
Postgres' type system.

It would be useful to have something like that, but AFAICS it would
take inventing some specialized SQL syntax construct to do it.
Which no one has gotten around to defining, let alone implementing.
(Ideas welcome, though.)

IIRC, pltcl has some reasonably convenient facilities for creating
SQL arrays based on translation from Tcl arrays.  Also, I'll bet
that Joe Conway's upcoming plr makes it just as easy as pie (once
you learn R, anyway).  But plain SQL and plpgsql don't really have
much to fall back on to support such things.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: not exactly a bug report, but surprising behaviour
Next
From: Tom Lane
Date:
Subject: Re: databases limit