Re: TABLE command

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: TABLE command
Дата
Msg-id 603c8f070811081050k79926d12x6547ae72abaa41af@mail.gmail.com
обсуждение исходный текст
Ответ на TABLE command  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: TABLE command  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi,

I was assigned to code-review this patch by pgsql-rrreviewers.  I
don't have much to add to what's already been written, but here are my
thoughts.

1. I agree with Tom Lane's earlier comments that table_ref is not the
correct non-terminal. For example, this seems pretty strange:

rhaas=# table position('i' in 'team');position
----------       0

As far as I can tell from looking around a bit (I don't actually have
a copy of the SQL:2008 spec), the intention is to allow only base
tables or views or references to WITH tables that are in scope.  I'm
not sure there's any good reason for that, but with TABLE as the key
word it's just too weird to allow random functions, function-like
operators, etc.

2. Realizing that this patch may have only been intended as a
proof-of-concept, it's pretty incomplete.  In addition to updating the
SGML documentation, it needs to update the psql documentation and tab
completion code, and maybe other, similar things that I'm not thinking
of.

rhaas=# \h table
No help available for "table".
Try \h with no arguments to see available help.

Incidentally, I noticed while looking at this that "\h with" also
fails, even though WITH can now be the first word of a valid SQL
statement.  I think we ought to patch psql to return the same help for
WITH as it does for SELECT.

3. Although I don't feel strongly about it, I tend to disagree with
the notion that "we don't need this".  It's not the most useful
feature in the world, but it's in the spec, and there are situations
where it may save a bit of typing.  Since SQL tends to be somewhat
wordy, I think this is a good thing.  YMMV.

I will update the status of this patch on the Wiki to "Waiting on author".

...Robert


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

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: Windowing Function Patch Review -> Standard Conformance
Следующее
От: Tom Lane
Дата:
Сообщение: Re: TABLE command