Bug with view definition? - Mailing list pgsql-general

From Sebastian Böck
Subject Bug with view definition?
Date
Msg-id 42A70E95.5000505@freenet.de
Whole thread Raw
Responses Re: Bug with view definition?  (Richard Huxton <dev@archonet.com>)
Re: Bug with view definition?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Hello all,

why is the last definition of a view not working, although the
documentation says all three are equal?

Testcase:

CREATE SCHEMA one;
CREATE SCHEMA two;

CREATE TABLE one.one (
    id SERIAL PRIMARY KEY
);

CREATE TABLE two.two (
    id SERIAL PRIMARY KEY
);

CREATE TABLE join1 (
    id SERIAL PRIMARY KEY
);

CREATE OR REPLACE VIEW working AS
    SELECT one.*
    FROM one.one
    JOIN two.two ON TRUE
    JOIN join1 ON join1.id = one.id;

CREATE OR REPLACE VIEW also_working AS
    SELECT one.*
    FROM one.one
    CROSS JOIN two.two
    JOIN join1 ON join1.id = one.id;

CREATE OR REPLACE VIEW not_working AS
    SELECT one.*
    FROM one.one, two.two
    JOIN join1 ON join1.id = one.id;

Thanks in advance

Sebastian

pgsql-general by date:

Previous
From: Marco Colombo
Date:
Subject: Re: vulnerability/SSL
Next
From: Dan Black
Date:
Subject: Foreign keys and slow insert