Suggestion - Document a currently undocumented(?) feature - SELECT Table FROM Table

Поиск
Список
Период
Сортировка
От Christos Evaggelou
Тема Suggestion - Document a currently undocumented(?) feature - SELECT Table FROM Table
Дата
Msg-id CAOToY7hZhQ5q9HOTXPu9tt4g5OtLX51NY-Zh3TmpgyBqritYMw@mail.gmail.com
обсуждение исходный текст
Список pgsql-docs
Hello, wonderful people who are providing us with a wonderful piece of software!

Just wanted to suggest that an existing feature is included in the documentation. It seems to be undocumented now. Also I don't think it's an obvious feature. I looked carefully under the reference section for SELECT,  under the section talking about Composite Types, under the section talking about ROW() and a bunch of other places but I couldn't find it. This makes me hesitate to use it, because I don't know if and how much I can rely on a feature that *seems* undocumented -- by the way, if it *is* documented somewhere, I apologize in advance.

So, you can use the table name in the SELECT list to pack the columns of the resultset into a composite datatype matching the table type. For example, if I have a table called JOB_LOG, I can do this:

testdb=# Select JOB_LOG From JOB_LOG Limit 2;
                                 job_log
--------------------------------------------------------------------------
 (1,"2014-08-17 08:32:04.058247","dequeue: Retrieving next pending job",)
 (2,"2014-08-17 08:32:04.108799","dequeue: No more jobs",)
(2 rows)

testdb=#

I hope you consider documenting this feature.
Thank you guys. Keep up the good work!

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

Предыдущее
От: Marko Tiikkaja
Дата:
Сообщение: CREATE_REPLICATION_SLOT exported snapshot
Следующее
От: Alexander Law
Дата:
Сообщение: Invalid field name in RLS description