Re: Make LANGUAGE SQL the default

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Make LANGUAGE SQL the default
Date: 2020-10-10 16:30:26
Message-ID: CAFj8pRBKaKqigv5A5iKnbLaetQ1OigpFKpdCybGmBA58UskG-w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

so 10. 10. 2020 v 18:14 odesílatel Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> napsal:

> 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.
>

+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
>
>
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-10-10 17:42:58 Re: BUG #15858: could not stat file - over 4GB
Previous Message Tom Lane 2020-10-10 16:14:18 Re: Make LANGUAGE SQL the default