BUG #3596: "insert ... returning *" not usable as last statement in a function...

Поиск
Список
Период
Сортировка
От Ciprian Dorin Craciun
Тема BUG #3596: "insert ... returning *" not usable as last statement in a function...
Дата
Msg-id 200709031713.l83HDekd055443@wwwmaster.postgresql.org
обсуждение исходный текст
Список pgsql-bugs
The following bug has been logged online:

Bug reference:      3596
Logged by:          Ciprian Dorin Craciun
Email address:      ciprian.craciun@gmail.com
PostgreSQL version: 8.2.4
Operating system:   Debian Etch (4.0)
Description:        "insert ... returning *" not usable as last statement in
a function...
Details:

I think the best explanation is the example just above...

The idea is that in 8.2 insert statement was modified by adding an returning
option, that modifies insert to behave also as a select statement by
returning all the rows inserted. But unfortunately this option can not be
used inside functions that return something as a last statement...

create table table1 ( field int );

create function function1 ( int ) returns table1 as $$
    insert into table1 values ($1) returning *;
$$ language sql;

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

Предыдущее
От: "Heikki Linnakangas"
Дата:
Сообщение: Re: BUG #3595: Segmentation fault with a simple select query
Следующее
От: Ben Kim
Дата:
Сообщение: Re: BUG #3591: autovacuum crash