Re: NATURAL INNER JOIN no longer working

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Diana Nemirovsky <diana(at)marinconsulting(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: NATURAL INNER JOIN no longer working
Date: 2005-07-18 14:32:04
Message-ID: 20050718072911.V70111@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Mon, 18 Jul 2005, Diana Nemirovsky wrote:

> Sorry for the vagueness of the last post, I'll try again.
>
> After adding columns onto each table in my schema, queries that used to
> work no longer work. I ran the following code on each table:
>
> ALTER TABLE person ADD COLUMN record_created TIMESTAMP;
> ALTER TABLE person ADD COLUMN record_created_by_user INT2;
> ALTER TABLE person ADD COLUMN record_modified TIMESTAMP;
> ALTER TABLE person ADD COLUMN record_modified_by_user INT2;
>
> Shortly after having done so, queries that used to work now don't. I can't
> say with certainty that the two are related, but the timing fits. So, for
> example,
> SELECT id_blog
> FROM blog NATURLAL INNER JOIN person_blog_role
> WHERE ID_blog_role != 6 AND id_person=590 and blog.top_level='news' AND
> blog.title<>'School Notes'
> GROUP by id_blog
>
> now returns nothing, whereas before it correctly found a handful of records.

Which makes sense since they now have common column names that probably
don't match in value. NATURAL means find common column names and join
using those.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message operationsengineer1 2005-07-18 18:15:32 Re: NATURAL INNER JOIN no longer working
Previous Message Diana Nemirovsky 2005-07-18 14:14:05 NATURAL INNER JOIN no longer working