Re: BUG #2016: query working with 8.0 fails with 8.1

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: "Pit Mueller" <fmi-soft(at)gmx(dot)de>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2016: query working with 8.0 fails with 8.1
Date: 2005-11-02 13:59:36
Message-ID: 200511021459.36991.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Pit Mueller wrote:
> SELECT p.conname AS constraint_name FROM pg_constraint p WHERE
> p.contype = 'p' AND p.conrelid = pg_class.oid AND pg_class.relname =
> 'mytablename'
>
> leads to an error:
>
> ERROR: missing FROM-clause entry for table "pg_class"

You need to mention pg_class in the FROM clause.

> This query worked fine with 8.0.3.

The query was always incorrect, and 8.1 is now stricter in that regard.
To get bugward-compatible behavior, look up the configuration parameter
add_missing_from.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Eisentraut 2005-11-02 14:01:11 Re: BUG #2015: typo in sql_help
Previous Message Pit Mueller 2005-11-02 07:55:00 BUG #2016: query working with 8.0 fails with 8.1