19 messages in org.postgresql.pgsql-generalRe: plperl -- postgresql married to perl
FromSent OnAttachments
Soma InterestingMar 29, 2001 2:38 pm 
Jeff EckermannMar 30, 2001 9:29 am 
Soma InterestingMar 30, 2001 10:06 am 
Soma InterestingMar 30, 2001 10:57 am 
Soma InterestingMar 30, 2001 1:58 pm 
Jeff EckermannMar 30, 2001 2:09 pm 
Soma InterestingMar 30, 2001 2:33 pm 
will trillichMar 30, 2001 3:46 pm 
Soma InterestingMar 30, 2001 4:38 pm 
will trillichMar 30, 2001 4:47 pm 
Soma InterestingMar 30, 2001 6:02 pm 
Eric G. MillerMar 30, 2001 7:29 pm 
Tom LaneMar 30, 2001 9:42 pm 
will trillichMar 30, 2001 10:04 pm 
will trillichMar 30, 2001 10:13 pm 
Tom LaneMar 31, 2001 4:57 pm 
will trillichApr 1, 2001 9:23 pm 
Tom LaneApr 1, 2001 11:27 pm 
Soma InterestingApr 3, 2001 1:23 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: plperl -- postgresql married to perlActions...
From:will trillich (wi@serensoft.com)
Date:Mar 30, 2001 10:13:06 pm
List:org.postgresql.pgsql-general

On Fri, Mar 30, 2001 at 06:02:27PM -0800, Soma Interesting wrote:

At 06:47 PM 3/30/2001 -0600, you wrote:

I may be able to use array's if postgres will allow using variables to reference points in the array.

OK, so how do I reference a specific element of an array in a record within pl/pgsql.

I've tried:

NEW.name[1] NEW.name.1

hmm. maybe it's NEW that's the problem...?

create table gunk( val varchar[] );

insert into gunk values ( '{"first string","another value","the end"}' ) ;

select val[2] from gunk;

val --------------- another value (1 row)

i'd think

table.field[index]

should do the trick, even in plpgsql:

myvar := select name[index] from new;

myvar := new.name[somevariable];

myary := new.name; myvar := myary[someindexvar];

no? (unless <guess> maybe the plpgsql compiler doesn't like variable subscript values </guess>, which would warrant keel hauling everyone responsible...)