[HACKERS] FROM clause omitted

2003-07-16 Thread Dennis Björklund
I had a bug in one of my queries that wasn't detected by pg because if 
filled in the from clause by itself. Take for example a querie like

select foo.a;

which I guess is transformed to

select foo.a
from foo;

Is this really a good thing to do? Is it part of the standard? Can it be
turned of? In my case it hid a bug and made my query work but produce the
wrong result.

Isn't this yet another case of helpful parsing that will only hurt in
the end? Look at how hard it is to parse html-pages because all browsers
accept broken code, but different broken code.

What about an example like this (the transformed code above but with alias
x added):

select foo.a
from foo x;

By adding the alias x the query still workes but gives a different result.

-- 
/Dennis


---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings


Re: [HACKERS] FROM clause omitted

2003-07-16 Thread Rod Taylor
 Is this really a good thing to do? Is it part of the standard? Can it be
 turned of? In my case it hid a bug and made my query work but produce the
 wrong result.

7.4 has a switch to turn this off for the same reasons you cite.


signature.asc
Description: This is a digitally signed message part


Re: [HACKERS] FROM clause omitted

2003-07-16 Thread Christoph Haller

 I had a bug in one of my queries that wasn't detected by pg because if

 filled in the from clause by itself. Take for example a querie like

 select foo.a;

 which I guess is transformed to

 select foo.a
 from foo;

 Is this really a good thing to do? Is it part of the standard? Can it
be
 turned of? In my case it hid a bug and made my query work but produce
the
 wrong result.

 Isn't this yet another case of helpful parsing that will only hurt
in
 the end? Look at how hard it is to parse html-pages because all
browsers
 accept broken code, but different broken code.

 What about an example like this (the transformed code above but with
alias
 x added):

 select foo.a
 from foo x;

 By adding the alias x the query still workes but gives a different
result.

Dennis,
This feature has been addressed many times before.
Please search the archives and refer to Extensions within SELECT doc.
AFAIK it can even be turned off, but don't know how exactly.
As I said, search the archive.
HTH
Regards, Christoph




---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send unregister YourEmailAddressHere to [EMAIL PROTECTED])


Re: [HACKERS] FROM clause omitted

2003-07-16 Thread Bruno Wolff III
On Wed, Jul 16, 2003 at 08:29:01 +0200,
  Dennis Björklund [EMAIL PROTECTED] wrote:
 I had a bug in one of my queries that wasn't detected by pg because if 
 filled in the from clause by itself. Take for example a querie like

Currently this is the only way to use additional tables when doing a delete.

---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings