Re: BUG #8893: Precompiler ECPG doesn't check Var-List in Select corrrect.

From: Boszormenyi Zoltan <zboszor(at)pr(dot)hu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, herbert(dot)grohmann(at)vallourec(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #8893: Precompiler ECPG doesn't check Var-List in Select corrrect.
Date: 2014-01-20 22:20:22
Message-ID: 52DDA126.8040003@pr.hu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

2014-01-20 16:36 keltezéssel, Tom Lane írta:
> herbert(dot)grohmann(at)vallourec(dot)com writes:
>> EXEC SQL SELECT
>> ...
>> sugru_1,sugru_2,sugru_3,sugru_4,sugru_5,sugru_6,sugru_7,sugru_8,sugru_9
>> stoerzeit_a11,stoerzeit_a12,stoerzeit_a13,stoerzeit_a14,stoerzeit_a15,stoerzeit_a16
>> ...
>> Missing Komma after sugru_9 does not produce a Compiler Error!
> Unfortunately, that's legal SQL syntax: stoerzeit_a11 is taken as a column
> alias for sugru_9, even without AS in front of it.
>
> This might not be the single worst syntax choice the SQL standards
> committee ever made, but it's certainly in the running for that
> distinction. Unfortunately, we're pretty much stuck with it :-( --- even
> if we didn't want to follow the standard as best we can, there is a whole
> lot of SQL code out there that depends on being able to omit AS.

Still, this particular problem may be caught by the preprocessor.
The SELECT targetlist is not "*", so the number of members for both
the targetlist and the user structure (INTO :s_schichtsatz) are known.

Best regards,
Zoltán Böszörményi

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2014-01-20 23:48:13 Re: BUG #8893: Precompiler ECPG doesn't check Var-List in Select corrrect.
Previous Message Tom Lane 2014-01-20 18:53:33 Re: [HACKERS] surprising to_timestamp behavior