pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: pgsql-sql@postgresql.org
Cc: mail@joeconway.com
Subject: Array_append does not work with Array variables in PL/pgSQL?
Date: Thu, 1 Apr 2004 13:20:37 -0800
Message-ID: <200404011320.37766.josh@agliodbs.com> (raw)

Folks,

See if you can spot any mistake I'm making here.   I've declared the following 
array variables in a plpgsql function:

 v_vals TEXT[];
 n_vals TEXT[];

After some manipulation, I try to synch them:

n_vals := array_append(n_vals, v_vals[arrloop]);
val_result := v_vals[arrloop];
RAISE NOTICE ''orig value %'', val_result;
val_result := array_to_string(n_vals, '', '');
RAISE NOTICE ''derived value %'', val_result;

And I get:

NOTICE:  orig value 04/01/2004
NOTICE:  derived value <NULL>
NOTICE:  orig value 04/01/2004
NOTICE:  derived value <NULL>

It seems like I cannot assign new elements to arrays inside a PL/pgsql 
function.   What gives here?  

PostgreSQL 7.4.1 on Linux.

-- 
-Josh Berkus
 Aglio Database Solutions
 San Francisco




view thread (5+ messages)  latest in thread

Message-ID: <200404011320.37766.josh@agliodbs.com>
Permalink:  ../200404011320.37766.josh@agliodbs.com/
Also on:    postgresql.org/message-id/200404011320.37766.josh@agliodbs.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: josh@agliodbs.com, mail@joeconway.com
  Subject: Re: Array_append does not work with Array variables in PL/pgSQL?
  In-Reply-To: <200404011320.37766.josh@agliodbs.com>

* 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