Re: plpgsql question...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Steve Wampler <swampler(at)noao(dot)edu>
Cc: postgres-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: plpgsql question...
Date: 2000-06-07 23:31:20
Message-ID: 5351.960420680@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Steve Wampler <swampler(at)noao(dot)edu> writes:
> PostgreSQL 6.5.3

> ========================
> appdb=> create function insert_or_update() returns opaque as '
> appdb'> begin
> appdb'> insert into attributes_table values(new.id,new.name,
> appdb'> new.units,new.value);
> appdb'> return NULL;
> appdb'> end;'
> appdb-> language 'plpgsql';
> CREATE
> appdb=> create trigger t before insert on attributes for each row
> appdb-> execute procedure insert_or_update();
> CREATE
> appdb=> insert into attributes values('site','prefix','none','kp');
> NOTICE: plpgsql: ERROR during compile of insert_or_update near line 2
> ERROR: syntax error at or near "in"
> appdb=>
> =========================

> Does anyone see what I've done wrong?

Nothing that I can see. I copied and pasted this trigger into current
sources and it worked fine. Ditto for your other example.

There must be something pretty broken about your copy of plpgsql;
dunno what exactly. I'd recommend updating to 7.0.2 and then seeing
if the problem persists. If it does we can dig deeper.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2000-06-07 23:35:14 Re: make us of old database.
Previous Message John Daniels 2000-06-07 23:25:47 JSQL for PostgreSQL?