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;

-- 


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to [EMAIL PROTECTED] so that your
       message can get through to the mailing list cleanly

Reply via email to