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 ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])