Re: Allowing empty target list in SELECT (1b4f7f93b4693858cb983af3cd557f6097dab67b)

Поиск
Список
Период
Сортировка
От Rajeev rastogi
Тема Re: Allowing empty target list in SELECT (1b4f7f93b4693858cb983af3cd557f6097dab67b)
Дата
Msg-id BF2827DCCE55594C8D7A8F7FFD3AB7713DDE577B@SZXEML508-MBX.china.huawei.com
обсуждение исходный текст
Ответ на Re: Allowing empty target list in SELECT (1b4f7f93b4693858cb983af3cd557f6097dab67b)  (Amit Langote <amitlangote09@gmail.com>)
Список pgsql-hackers
On 02 May 2014 10:00, Amit Longote Wrote:

> > I
> > s the following behavior perceived fix-worthy?
> >
> >
> > -- note the
> > '
> > 1's
> >  in the output
> > s
> >
> > po
> > stgres=# CREATE TABLE test AS SELECT;
> > SELECT 1
> >
> > postgres=# insert into test select;
> > INSERT 0 1
> >
> 
> Or maybe, it just means 1 'null' row/record and not no row at all?

It just creates an item pointer and corresponding to that heap tuple header (without data or bitmask for NULL) gets
storedas part of this insertion.
 
So though it does not insert anything (not even NULL) but still it reserve one row position. 
So while SELECT, it will not display anything but it will show actual number of rows.

Even below syntax is also allowed:
CREATE TABLE no_column_table();

IMO, this might be useful for dynamic use of table (later column might be added using 'ALTER') or to use as abstract
ancestorin class hierarchy.
 


Thanks and Regards,
Kumar Rajeev Rastogi


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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: is there a hook by which we can modify input query before postgresql builds raw parse tree
Следующее
От: Ian Barwick
Дата:
Сообщение: pgaudit - an auditing extension for PostgreSQL