Re: New warning code for missing FROM relations

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: New warning code for missing FROM relations
Date: 2000-06-05 00:21:14
Message-ID: Pine.LNX.4.21.0006041731260.8545-100000@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Philip Warner writes:

> > SELECT *
> > INTO TABLE tmp1
> > FROM tmp
> > WHERE onek.unique1 < 2;
> > NOTICE: Adding missing FROM-clause entry for table onek

> Is is worth adding yet another setting, eg. set sql92=strict, which
> would disallow such flagrant breaches of the standard?

SQL provides for facility called the SQL Flagger, which is supposed to do
exactly that. This might sound like an interesting idea but in order for
it to be useful you'd have to maintain it across the board, which sounds
like a major head ache.

The irony in the given example is that the SELECT INTO command isn't in
the standard in the first place so you'd have to create all sorts of
double standards. Certain things would be "extensions", certain things
would be "misuse". And for all it's worth, we have no idea which is which.

If you want to throw about warnings about "probable" coding errors and the
like one *must* be able to switch them off. Either something is right,
then you shut up. Or it's wrong, then you throw an error. Or you're not
sure, then you better leave it up to the user.

--
Peter Eisentraut Sernanders väg 10:115
peter_e(at)gmx(dot)net 75262 Uppsala
http://yi.org/peter-e/ Sweden

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Lamar Owen 2000-06-05 01:26:31 Re: 7.0.1 Problems.
Previous Message Peter Eisentraut 2000-06-05 00:20:58 ODBC configure