No error when column doesn't exist - Mailing list pgsql-general

From Dean Rasheed
Subject No error when column doesn't exist
Date
Msg-id BAY102-W9B6A6BCCA4DD85B34F56CF2570@phx.gbl
Whole thread Raw
Responses Re: No error when column doesn't exist  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
I've just spent a couple of hours tracking down a bug which turned out
to be a typo in my code. What surprises me is that the SQL in question
didn't immediately produce an error. Here's a simplified example:

CREATE TABLE foo(a int, b int);
INSERT INTO foo VALUES(1,2);
SELECT foo.text FROM foo;

I expected that to generate an error: column foo.text does not exist.
Instead it treats "foo.text" as "foo.*::text AS text":

SELECT foo.text FROM foo;
 text
-------
 (1,2)
(1 row)

If foo actually does have a column called text, this works as expected,
selecting just that column.

Is this a feature or a bug?

Dean

_________________________________________________________________
Make a mini you and download it into Windows Live Messenger
http://clk.atdmt.com/UKM/go/111354029/direct/01/

pgsql-general by date:

Previous
From: Andy Colson
Date:
Subject: Re: 64-bit Compile Failure on Solaris 10 with OpenSSL
Next
From: Jeff Ross
Date:
Subject: Re: Can interval take a value from a field?