differences between function returning 'setof table' and 'table'

Поиск
Список
Период
Сортировка
От Gerardo Herzig
Тема differences between function returning 'setof table' and 'table'
Дата
Msg-id 4C23DB86.5040805@fmed.uba.ar
обсуждение исходный текст
Список pgsql-sql
Hi all. I dont understand why this is happening. Simple hardcoded
function, looking for an id who doesn't exists:


REATE FUNCTION pp()
returns setof public.pp
as
$$
select * from public.pp where id=999999;
$$ language sql;

So there is no id=99999 in table public.pp
test=# SELECT * from pp();id| descripcion|
------------+-------------+
(0 filas)


Great

Now, when the function is defined to return
`returns public.pp', when i execute it...

test=# SELECT * from pp();id | descripcion
------------+-------------           |             |
(1 fila)

1 record? Why? Is this the expected behaviour?

this is pg 8.3.11

Thanks!
Gerardo


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

Предыдущее
От: Petru Ghita
Дата:
Сообщение: Re: question about partitioning
Следующее
От: Thom Brown
Дата:
Сообщение: Re: [GENERAL] How to Insert and retrieve multilingual (Hindi "an Indian language") into PostgreSQL