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

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: trying to learn plpqsql... so please forgive..
Дата
Msg-id web-1834137@davinci.ethosmedia.com
обсуждение исходный текст
Ответ на trying to learn plpqsql... so please forgive..  (Michiel Lange <michiel@minas.demon.nl>)
Ответы Re: trying to learn plpqsql... so please forgive..  (Michiel Lange <michiel@minas.demon.nl>)
Список 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 INSERTtrigger can modify the inserted data, or reject it,
orupdate 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



В списке pgsql-sql по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Problems invoking psql. Help please.
Следующее
От: Oliver Elphick
Дата:
Сообщение: Re: Problems invoking psql. Help please.