Skip site navigation (1) Skip section navigation (2)

BUG #1854: SQL Bug

From: "Christian Almeida" <cbalmeida(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #1854: SQL Bug
Date: 2005-08-29 00:38:55
Message-ID: 20050829003855.1D9DDF0B8B@svr2.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      1854
Logged by:          Christian Almeida
Email address:      cbalmeida(at)gmail(dot)com
PostgreSQL version: 8.0
Operating system:   Windows XP SP2
Description:        SQL Bug
Details: 

Should this sql work?

I just picked 3 tables from pg_catalog and build this query. It really
should not work, because there's a reference to a table
(PG_CATALOG.PG_CLASS) wich is not listed in any from clauses.

Try it yourself:

SELECT
  *
FROM
  PG_CATALOG.PG_AM
WHERE
  NOT EXISTS
  (
  SELECT
    1
  FROM
    PG_CATALOG.PG_CAST
  WHERE
    PG_CATALOG.PG_CLASS.RELOWNER = PG_CATALOG.PG_AM.AMOWNER
  )

Cheers,

Christian Almeida.

SELECT
  *
FROM
  PG_CATALOG.PG_AM
WHERE
  NOT EXISTS
  (
  SELECT
    1
  FROM
    PG_CATALOG.PG_CAST
  WHERE
    PG_CATALOG.PG_CLASS.RELOWNER = PG_CATALOG.PG_AM.AMOWNER
  )

Responses

pgsql-bugs by date

Next:From: Vladimir KanazirDate: 2005-08-29 13:45:33
Subject: BUG #1855: usage of indexes
Previous:From: Bruce MomjianDate: 2005-08-28 22:20:32
Subject: Re: CVS Head - message formatting issue in initdb on Win32

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group