Re: Removing WITH clause support in CREATE FUNCTION, for isCachable and isStrict
От
Tom Lane
Тема
Re: Removing WITH clause support in CREATE FUNCTION, for isCachable and isStrict
Дата
Msg-id
11283.1516923004@sss.pgh.pa.us
Ответ на
Re: Removing WITH clause support in CREATE FUNCTION, for isCachable and isStrict (Daniel Gustafsson)
Список
Дерево обсуждения
Removing WITH clause support in CREATE FUNCTION, for isCachable andisStrict Michael Paquier <michael.paquier@gmail.com>
Re: Removing WITH clause support in CREATE FUNCTION, for isCachable and isStrict Daniel Gustafsson <daniel@yesql.se>
Re: Removing WITH clause support in CREATE FUNCTION, for isCachable and isStrict Tom Lane <tgl@sss.pgh.pa.us>
Re: Removing WITH clause support in CREATE FUNCTION, for isCachableand isStrict Michael Paquier <michael.paquier@gmail.com>
Re: Removing WITH clause support in CREATE FUNCTION, for isCachable and isStrict Tom Lane <tgl@sss.pgh.pa.us>
Re: Removing WITH clause support in CREATE FUNCTION, for isCachableand isStrict Michael Paquier <michael.paquier@gmail.com>
Re: Removing WITH clause support in CREATE FUNCTION, for isCachableand isStrict Robert Haas <robertmhaas@gmail.com>
Daniel Gustafsson writes: >> On 15 Jan 2018, at 03:27, Michael Paquier wrote: >> As noticed by Daniel here: >> https://www.postgresql.org/message-id/D5F34C9D-3AB7-4419-AF2E-12F67581D71D@yesql.se > In that thread I proposed a patch to fix this, but I certainly don’t object to > just removing it to make both syntax and code clearer. +1 I poked into the git log and confirmed Michael's statement that CREATE FUNCTION ... WITH has been documented as deprecated since 7.3 (commit 94bdc4855 to be exact). I think the original intention was that we'd keep it for PG-specific function attributes (ie those not found in the SQL spec), so as to avoid creating keywords for every attribute we thought of. That intention has been roundly ignored since then, though, since COST and ROWS and LEAKPROOF and PARALLEL (UN)SAFE have all been implemented as separate keywords not WITH options. I'm dubious that that was a good plan, but it's probably too late to change direction now. The only other argument I can see for keeping it is that pre-7.3 dump files could contain CREATE FUNCTION commands with the old spelling. But, even assuming somebody is still running <= 7.2 and wants to migrate to >= 11 in one jump, they could use some intermediate version of pg_dump to produce a dump with the modern spelling, or just whip out their trusty text editor. Maintaining backwards compatibility is good, but 15 years seems like enough. In short, I'm on board with removing the WITH clause. I've not reviewed the patch in detail, but will do so and push it if there's not objections pretty soon. regards, tom lane
В списке pgsql-hackers по дате отправления