Re: Removing WITH clause support in CREATE FUNCTION, for isCachable and isStrict

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Postgres hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Removing WITH clause support in CREATE FUNCTION, for isCachable and isStrict
Date: 2018-01-25 23:30:04
Message-ID: 11283.1516923004@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Daniel Gustafsson <daniel(at)yesql(dot)se> writes:
>> On 15 Jan 2018, at 03:27, Michael Paquier <michael(dot)paquier(at)gmail(dot)com> 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2018-01-25 23:33:41 Documentation of pgcrypto AES key sizes
Previous Message Daniel Gustafsson 2018-01-25 23:27:16 Re: [HACKERS] GnuTLS support