replacing a view: bug or feature?

From: "Ed L(dot)" <pgsql(at)bluepolka(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: replacing a view: bug or feature?
Date: 2004-12-08 03:03:09
Message-ID: 200412072003.09019.pgsql@bluepolka.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Is the error below a bug? Or a feature?

% cat foo.sql

SELECT version();
CREATE TABLE foo ( "key" serial NOT NULL PRIMARY KEY, msg character(100));
CREATE TABLE bar ( "key" serial NOT NULL PRIMARY KEY, msg character(100));
CREATE VIEW baz AS SELECT * FROM foo UNION ALL SELECT * FROM bar;
CREATE OR REPLACE VIEW baz AS SELECT * FROM foo;

% psql -e -f foo.sql
SELECT version();
version
---------------------------------------------------------------------------------------------------------
PostgreSQL 7.4.6 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.2.2
20030222 (Red Hat Linux 3.2.2-5)
(1 row)

CREATE TABLE foo ( "key" serial NOT NULL PRIMARY KEY, msg character(100));
psql:foo.sql:3: NOTICE: CREATE TABLE will create implicit sequence
"foo_key_seq" for "serial" column "foo.key"
psql:foo.sql:3: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit
index "foo_pkey" for table "foo"
CREATE TABLE
CREATE TABLE bar ( "key" serial NOT NULL PRIMARY KEY, msg character(100));
psql:foo.sql:4: NOTICE: CREATE TABLE will create implicit sequence
"bar_key_seq" for "serial" column "bar.key"
psql:foo.sql:4: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit
index "bar_pkey" for table "bar"
CREATE TABLE
CREATE VIEW baz AS SELECT * FROM foo UNION ALL SELECT * FROM bar;
CREATE VIEW
CREATE OR REPLACE VIEW baz AS SELECT * FROM foo;
psql:foo.sql:6: ERROR: cannot change data type of view column "msg"

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jean-Christian Imbeault 2004-12-08 05:33:00 Problems with JDBC site and Postgres mailing list subscription page
Previous Message Jan Wieck 2004-12-08 02:44:58 Re: When to encrypt

Browse pgsql-hackers by date

  From Date Subject
Next Message Sibtay Abbas 2004-12-08 11:48:18 old-style handler error
Previous Message Premsun Choltanwanich 2004-12-08 02:37:53 Re: How can I recovery old Data from files and