Re: WITH RECURSIVE ... simplified syntax?

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: WITH RECURSIVE ... simplified syntax?
Дата
Msg-id 87vdvzx7ew.fsf@oxford.xeocode.com
обсуждение исходный текст
Ответ на Re: WITH RECURSIVE ... simplified syntax?  (Josh Berkus <josh@agliodbs.com>)
Список pgsql-hackers
Josh Berkus <josh@agliodbs.com> writes:

> Tom Lane wrote:
>> Josh Berkus <josh@agliodbs.com> writes:
>>> Would it be a worth it for us to implement a non-standard simple syntax
>>> sugar on top of WITH RECURSIVE?  Or, at least, something like CONNECT_BY()?
>>
>> The Oracle syntax only *looks* simple.  When you start to study it
>> you realize that it's a horrid, messy kluge.
>
> Yeah. I was actually thinking more of something like:
>
> <table_identifier> RECURSIVE JOIN ON <column_expression> <operator>
> <column_expression>
>
> ... which would be a pretty good simplest-case syntax.
>
> When I mentioned connect_by() I was referring to Joe's function, not Oracle's
> syntax, which I think is awful.

Sounds good*... until you start thinking about the details. Which is precisely
where Oracle's syntax breaks down too. In the above syntax where do you
specify the base case? Where do you specify any restrictions which stop
infinite recursion? How do you get the recursion depth for a record? These
aren't optional bells and whistles, the feature is unusable without them,
basically every recursive query needs to use at least the first two and
usually all three.

* (actually it's awful but I think what you really meant to say was <table_ref> RECURSIVE JOIN <join_qual>)

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com Ask me about EnterpriseDB's RemoteDBA services!


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

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: Contrib, schema, and load_module
Следующее
От: "Ian Caulfield"
Дата:
Сообщение: Re: Window Functions patch v06