Re: trying to learn plpqsql... so please forgive..

From: "Josh Berkus" <josh(at)agliodbs(dot)com>
To: Michiel Lange <michiel(at)minas(dot)demon(dot)nl>, pgsql-sql(at)postgresql(dot)org
Subject: Re: trying to learn plpqsql... so please forgive..
Date: 2002-11-20 16:49:50
Message-ID: web-1834137@davinci.ethosmedia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Michiel,

> Maybe this should be sent to novice... I was not certain, but if it
> should, please tell me so.

No need to apologise. Novice would have been appropriate, but SQL is
OK too.

> When I do an 'INSERT INTO <table> VALUES <row1,row2,row3>'
> and on the table is a serial primary key named p_key.
> As I want this number to be auto-generated, but use it as a 'customer
> number', I want to create this function to return the value of this
> insert. I thought/hoped that this would work, but as there are some
> people dependant on this database, I dare not try out too much ;-)
> This would be the first time I used plpgsql, so I am not so certain
> about what I do.

Hmmm ... the trigger, as you've written it, won't work. An INSERT
trigger can modify the inserted data, or reject it, or update data in
other tables. But it cannot return data to the screen.

Can you break down, in more detail, what you're *trying* to do? It
can probably be done, but I'm still not clear on what you're
attempting.

-Josh Berkus

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Francisco Reyes 2002-11-20 16:52:38 Closing inactive connections OR user connections limits
Previous Message Juan Fernandez 2002-11-20 15:40:50 Re: Date trunc in UTC