Re: Array manipulation/syntax question - Mailing list pgsql-general

From Michael Fuhr
Subject Re: Array manipulation/syntax question
Date
Msg-id 20050510015834.GA65179@winnie.fuhr.org
Whole thread Raw
In response to Array manipulation/syntax question  (Bart Grantham <bart@logicworks.net>)
List pgsql-general
On Mon, May 09, 2005 at 07:05:18PM -0400, Bart Grantham wrote:
>
> Let me put it this way... how do I do this:
>
> -- my_array is an INT[]
>
> _my_array := select some_column from some_table;

In PostgreSQL 7.4 and later you can use an array constructor:

  my_array := ARRAY(SELECT some_column FROM some_table);

See "Array Constructors" in the "Value Expressions" section of the
"SQL Syntax" chapter of the documentation:

http://www.postgresql.org/docs/8.0/interactive/sql-expressions.html#SQL-SYNTAX-ARRAY-CONSTRUCTORS

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

pgsql-general by date:

Previous
From: David Fetter
Date:
Subject: Re: Array manipulation/syntax question
Next
From: Bruce Momjian
Date:
Subject: Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL