Re: How to access array elements via PL/pgSQL trigger?

From: Roland Roberts <roland(at)astrofoto(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: How to access array elements via PL/pgSQL trigger?
Date: 2001-12-28 05:25:36
Message-ID: m2wuz7ud9r.fsf@kuiper.rlent.pnet
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>>>>> "Tom" == Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

Tom> Most likely this error is not coming from plpgsql, but from
Tom> the core SQL parser spitting up on some transformed query
Tom> that plpgsql tried to feed it. It'll be educational to set
Tom> the debug level to 2 or more (in a fresh backend) and retry
Tom> the failing query. That should cause the postmaster log to
Tom> accumulate the queries being sent down to the SQL parser.

I'll try bumping up the debug level tomorrow morning when I'm awake
enough to know what I'm doing....

Tom> My first thought is that plpgsql may not support the syntax
Tom> arrayvar[subscript] := something
Tom> but I've not tried it.

But line 4 (where it *says* the error is located) reads

new.total := new.level[1] + ... ;

(which might be a variation of the same thing).

roland
--
PGP Key ID: 66 BC 3B CD
Roland B. Roberts, PhD RL Enterprises
roland(at)rlenter(dot)com 76-15 113th Street, Apt 3B
roland(at)astrofoto(dot)org Forest Hills, NY 11375

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joe Conway 2001-12-28 06:45:32 Re: First decent PostgreSQL CBT now on techdocs.postgresql.org
Previous Message Bruce Momjian 2001-12-28 05:08:59 Re: Modifying table ownership