X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 8B0DD475C3D for ; Thu, 1 May 2003 22:06:33 -0400 (EDT) Received: from earth.spaceship.com (earth.spaceship.com [66.45.120.60]) by postgresql.org (Postfix) with ESMTP id 10383474E4F for ; Thu, 1 May 2003 22:06:33 -0400 (EDT) Received: from spaceship.com (wwwrun@localhost [127.0.0.1]) by earth.spaceship.com (8.11.3/8.11.3) with SMTP id h4226bM15061 for ; Thu, 1 May 2003 21:06:37 -0500 Received: from cs24243219-116.austin.rr.com ([24.243.219.116]) (SquirrelMail authenticated user alien) by earth.spaceship.com with HTTP; Thu, 1 May 2003 21:06:37 -0500 (CDT) Message-ID: <34943.24.243.219.116.1051841197.squirrel@earth.spaceship.com> Date: Thu, 1 May 2003 21:06:37 -0500 (CDT) Subject: implied FROM From: "Matt Mello" To: X-Priority: 3 Importance: Normal X-MSMail-Priority: Normal Reply-To: alien@spaceship.com X-Mailer: SquirrelMail (version 1.2.1) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, hits=-5.7 required=5.0 tests=BAYES_10,MISSING_MIMEOLE,MISSING_OUTLOOK_NAME version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200305/11 X-Sequence-Number: 13176 Hello, all. New to this list. If this isn't the right place for this issue, please let me know. Here is a condensed version of the situation. I have two tables (STORE and APPLIANCE). They share a field name STOREID, where the field is a primary key in STORE and a foreign key in APPLIANCE. 1) Here is what I *should* have typed in: select appliance.storeid from appliance where appliance.applianceid =3D 32; 2) Here is what I accidentally typed in: select store.storeid from appliance where appliance.applianceid =3D 32; #1 gives me a single int4 column in a single-row resultset. #2 gives me a single int4 column in a resultset that has a row for every row in STORE. I finally figured out my error, but I would have found it much faster if the problem query had thrown an exception. So, why doesn't asking for a field from a table that IS NOT in the from clause throw an exception? Isn't it violating the SQL language? Why is PG implying FROM tables? Thanks! --=20 Matt Mello