Skip site navigation (1) Skip section navigation (2)

BUG #4247: (Possible) SQL miscontruct not flagged

From: "J6M" <j6m(at)adm(dot)estp(dot)fr>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #4247: (Possible) SQL miscontruct not flagged
Date: 2008-06-17 17:13:20
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      4247
Logged by:          J6M
Email address:      j6m(at)adm(dot)estp(dot)fr
PostgreSQL version: 8.1.13
Operating system:   Linux x86-64
Description:        (Possible) SQL miscontruct not flagged


This European afternoon, I was trying to count how many distinct values of a
row in a table exists and put this result in another table.

Instead of writing :

select distinct(ean13),(select count(*)  from fiart where ean13=a.ean13) as
n into zz from fiart as a ;

I wrote :

select distinct(ean13),(select count(*) into zz from fiart where
ean13=a.ean13) as n from fiart as a ;

I am not an expert in the most intricate shades of the SQL language. Should
the SQL interpreter not flag the query as a misconstruct statement and fire
an ERROR (or at least a WARNING) message ? (I'd guess it should).


pgsql-bugs by date

Next:From: Tom LaneDate: 2008-06-17 17:47:13
Subject: Re: BUG #4247: (Possible) SQL miscontruct not flagged
Previous:From: Dave PageDate: 2008-06-17 15:14:11
Subject: Re: BUG #4245: Product Name...

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group