Re: Arrays in pgsql

From: Martina Mostert <martina_mostert(at)gmx(dot)de>
To: Gregory Wood <gregw(at)com-stock(dot)com>
Cc: PostgreSQL-General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Arrays in pgsql
Date: 2002-03-04 14:57:37
Message-ID: 3C838B61.B865E51F@gmx.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thank you, I'll tell you if it works.

Gregory Wood wrote:
>
> > I'm working on a plpgsql-function. I need an array of type integer. The
> > Programmer's Guide says 'PL/pgSQL variables can have any SQL datatype',
> > so I'd say there should also be arrays - or am I wrong?
>
> You'd be wrong... arrays are *not* an SQL datatype. Arrays are a PostgreSQL
> construct.
>
> > monthday integer[12];
>
> > Any suggestions?
>
> The closest thing I can come up with is creating a simple table with an
> integer array column as a template, then you can declare a variable with a
> TYPE matching that table. For example:
>
> CREATE TABLE int_array_table (int_array integer[12]);
>
> Then you can say:
>
> monthday int_array_table.int_array%TYPE
>
> But to be honest, I haven't tried this, so I can't say if it works or not.
>
> Greg
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ioannis Kappas 2002-03-04 14:58:37 Re: postgre performance question
Previous Message Doug McNaught 2002-03-04 14:35:53 Re: postgre performance question