Re: [ADMIN] Functions

Поиск
Список
Период
Сортировка
От Rafael Domiciano
Тема Re: [ADMIN] Functions
Дата
Msg-id 3a0028490809301754h46458028v27877bfa7a665ee6@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [ADMIN] Functions  ("Scott Marlowe" <scott.marlowe@gmail.com>)
Список pgsql-general
Hello,

If you want to get the value of a autogenerated column it's better to use "RETURNING"
insert into something returning primary key...

Best Regards,

Rafael Domiciano
Postgres DBA

2008/9/15 Scott Marlowe <scott.marlowe@gmail.com>
On Mon, Sep 15, 2008 at 11:53 AM, c k <shreeseva.learning@gmail.com> wrote:
>
>
> If I have a function having:
> begin
> insert into something ...
> select max(primary key) from something..
> end;
>
> does the second statement within a function can view the results after
> execution of first statement to get max(P.K.)?

Yep.

--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

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

Предыдущее
От: Chris
Дата:
Сообщение: Re: MySQL to Postgresql schema conversion
Следующее
От: "Darren Weber"
Дата:
Сообщение: Has anyone built pgbash-7.3 against postgreSQL-8.3?