Re: Make LANGUAGE SQL the default - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: Make LANGUAGE SQL the default
Date
Msg-id CAFj8pRBKaKqigv5A5iKnbLaetQ1OigpFKpdCybGmBA58UskG-w@mail.gmail.com
Whole thread Raw
In response to Re: Make LANGUAGE SQL the default  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers


so 10. 10. 2020 v 18:14 odesílatel Tom Lane <tgl@sss.pgh.pa.us> napsal:
Peter Eisentraut <peter.eisentraut@2ndquadrant.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.

+1

Pavel


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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Make LANGUAGE SQL the default
Next
From: Tom Lane
Date:
Subject: Re: BUG #15858: could not stat file - over 4GB