pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Donald Fraser <demolish@cwgsy.net>
Cc: [ADMIN] <pgsql-admin@postgresql.org>
Subject: Re: Arrays in pl/pgsql functions
Date: Thu, 17 Jul 2003 14:18:42 -0400
Message-ID: <5658.1058465922@sss.pgh.pa.us> (raw)
In-Reply-To: <005701c34c55$8d017540$1664a8c0@DEMOLITION>
References: <005701c34c55$8d017540$1664a8c0@DEMOLITION>

"Donald Fraser" <demolish@cwgsy.net> writes:
> CREATE OR REPLACE FUNCTION test_arrays() RETURNS int4[] AS '
> DECLARE
>      test int4[];
> BEGIN
>     test[1] := 1;
>     RETURN test;
> END ' LANGUAGE 'plpgsql';

> If I try to execute this function I get:
> WARNING:  plpgsql: ERROR during compile of test_arrays near line 5
> ERROR:  syntax error at or near "["

Existing releases of plpgsql don't support assignment to array elements.
I believe Joe Conway has fixed this for 7.4, though.

			regards, tom lane



view thread (4+ messages)

Message-ID: <5658.1058465922@sss.pgh.pa.us>
Permalink:  ../5658.1058465922@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/5658.1058465922@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, demolish@cwgsy.net
  Subject: Re: Arrays in pl/pgsql functions
  In-Reply-To: <5658.1058465922@sss.pgh.pa.us>
  References: <005701c34c55$8d017540$1664a8c0@DEMOLITION> <5658.1058465922@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox