How do I create an array?

From: Greg Stark <gsstark(at)mit(dot)edu>
To: pgsql-general(at)postgresql(dot)org
Subject: How do I create an array?
Date: 2003-02-06 04:55:50
Message-ID: 87y94u2ejt.fsf@stark.dyndns.tv
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


I'm trying to create a function that operates on integer[]. It works great if
I have an integer[] column already in the table. However I don't see how to
create an array dynamically given two integers.

I could paste together a string representation and then cast it back using
something like ('{'||a||','||b||'}')::integer[] but that seems terribly
wasteful. And it doesn't seem to work anyways.

There must be something like the point() function for arrays, no? I'm probably
missing something obvious or looking in the wrong place? I just don't see it.

--
greg

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-02-06 05:05:01 Re: not exactly a bug report, but surprising behaviour
Previous Message Greg Stark 2003-02-06 04:44:50 Re: not exactly a bug report, but surprising behaviour