BUG #2755: strange select behavior

From: "Basil Evseenko" <evseenko(at)sysoft(dot)ru>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2755: strange select behavior
Date: 2006-11-12 16:49:33
Message-ID: 200611121649.kACGnXPx002257@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 2755
Logged by: Basil Evseenko
Email address: evseenko(at)sysoft(dot)ru
PostgreSQL version: 8.1.4
Operating system: Linux 2.6
Description: strange select behavior
Details:

# \d tables.cart

Column | Type |
Modifiers
-------------+--------------------------+-----------------------------------
--------------------------------
id | integer | not null default
nextval('tables.cart_id_seq'::regclass)
user_id | integer | not null
track_id | integer | not null
price | numeric(12,2) | default 0.0
size | integer | default 0
expire_date | timestamp with time zone | default (now() + '1
day'::interval)
timestamp | timestamp with time zone | default now()
ordered | integer | not null default 0
album_id | integer

# \d tables.download
Column | Type |
Modifiers
-----------+--------------------------+-------------------------------------
----------------------------------
id | integer | not null default
nextval('tables.download_id_seq'::regclass)
cart_id | integer | not null
http_info | character varying |
size | integer | default 0
timestamp | timestamp with time zone | default now()

# SELECT count(1) from tables.download where cart_id in (select cart_id from
tables.cart where user_id=1);
count
-------
2860
(1 row)

# select cart_id from tables.cart where user_id=1;
ERROR: column "cart_id" does not exist

Why in the first case select doestn't raise syntax error, but use cart_id
from tables.download?
Is this bug or a feature?

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2006-11-12 17:41:08 Re: 8.2beta1 (w32): server process crash (tsvector)
Previous Message Thomas H. 2006-11-12 16:27:58 Re: 8.2beta1 (w32): server process crash (tsvector)