Re: empty view, replace view, column type change? - Mailing list pgsql-sql

From Rod Taylor
Subject Re: empty view, replace view, column type change?
Date
Msg-id 1119557984.35441.95.camel@home
Whole thread Raw
In response to empty view, replace view, column type change?  (Markus Bertheau <twanger@bluetwanger.de>)
Responses Re: empty view, replace view, column type change?
List pgsql-sql
On Thu, 2005-06-23 at 22:03 +0200, Markus Bertheau wrote:
> Hi,
> 
> it seems to me that the following should work but it fails:
> 
> CREATE VIEW co AS SELECT LOCALTIMESTAMP::TIMESTAMP AS ov WHERE FALSE;
> CREATE TABLE link (ov TIMESTAMP);
> CREATE OR REPLACE VIEW co AS SELECT ov FROM link;

The data types are different, as one has the timestamp to (6) decimal
places after seconds.

development=# CREATE VIEW co AS SELECT LOCALTIMESTAMP::TIMESTAMP AS ov
WHERE FALSE;
CREATE VIEW
development=# CREATE TABLE link (ov TIMESTAMP);
CREATE TABLE
development=# CREATE OR REPLACE VIEW cod AS SELECT ov FROM link;
CREATE VIEW
development=# \d co                   View "rbt.co"Column |              Type              | Modifiers
--------+--------------------------------+-----------ov     | timestamp(6) without time zone |
View definition:SELECT 'now'::text::timestamp(6) without time zone AS ov WHERE false;

development=# \d cod                 View "rbt.cod"Column |            Type             | Modifiers
--------+-----------------------------+-----------ov     | timestamp without time zone |
View definition:SELECT link.ov  FROM link;

-- 



pgsql-sql by date:

Previous
From: Markus Bertheau
Date:
Subject: Re: empty view, replace view, column type change?
Next
From: Markus Bertheau
Date:
Subject: Re: empty view, replace view, column type change?