Re: Make LANGUAGE SQL the default

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Make LANGUAGE SQL the default
Date: 2020-10-10 16:14:18
Message-ID: 2887532.1602346458@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com> writes:
> A sub-patch extracted from the bigger patch in thread "SQL-standard
> function body"[0]: Make LANGUAGE SQL the default in CREATE FUNCTION and
> CREATE PROCEDURE, per SQL standard.

I'm suspicious of doing this, mainly because DO does not have that
default. I think sticking with no-default is less likely to cause
confusion. Moreover, I don't really believe that having a default value
here is going to add any noticeable ease-of-use for anyone. What's much
more likely to happen is that we'll start getting novice questions about
whatever weird syntax errors you get when trying to feed plpgsql code to
the sql-language function parser. (I don't know what they are exactly,
but I'll bet a very fine dinner that they're less understandable to a
novice than "no language specified".)

I don't see any reason why we can't figure out that an unquoted function
body is SQL, while continuing to make no assumptions about a body written
as a string. The argument that defaulting to SQL makes the latter case
SQL-compliant seems pretty silly anyway.

I also continue to suspect that we are going to need to treat quoted
and unquoted SQL as two different languages, possibly with not even
the same semantics. If that's how things shake out, claiming that the
quoted-SQL version is the default because spec becomes even sillier.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2020-10-10 16:30:26 Re: Make LANGUAGE SQL the default
Previous Message Andrey Borodin 2020-10-10 16:00:07 Re: Batching page logging during B-tree build