Re: How do I create an array?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How do I create an array?
Date: 2003-02-06 05:24:31
Message-ID: 9474.1044509071@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Greg Stark <gsstark(at)mit(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-02-06 05:30:03 Re: databases limit
Previous Message Tom Lane 2003-02-06 05:05:01 Re: not exactly a bug report, but surprising behaviour