Re: minor view creation weirdness - Mailing list pgsql-hackers

From Oliver Elphick
Subject Re: minor view creation weirdness
Date
Msg-id 1065087185.2921.42.camel@linda.lfix.co.uk
Whole thread Raw
In response to Re: minor view creation weirdness  (Greg Stark <gsstark@mit.edu>)
List pgsql-hackers
On Thu, 2003-10-02 at 08:40, Greg Stark wrote:
> Neil Conway <neilc@samurai.com> writes:
> 
> > Is this a bug?
> > 
> > (using CVS code from yesterday)
> > 
> > nconway=# create view baz (a,b) as select 'hello', 'world';
> > WARNING:  column "a" has type "unknown"
> > DETAIL:  Proceeding with relation creation anyway.
> > WARNING:  column "b" has type "unknown"
> > DETAIL:  Proceeding with relation creation anyway.
> > CREATE VIEW
> > nconway=# 
> 
> 7.3 does the same thing actually. I don't know what that means though.

junk=# \d baz      View "public.baz"Column |   Type    | Modifiers
--------+-----------+-----------a      | "unknown" |b      | "unknown" |
View definition:SELECT 'hello' AS a, 'world' AS b;

There is no table behind the view, so there is no way for PostgreSQL to
derive the column types of a and b.  A quoted string (as supplied in the
view definition) could be one of text, varchar, char, date, time,
timestamp, cidr and so on.


-- 
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight, UK                             http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
========================================   "Set your affection on things above, not on things on      the earth."
  Colossians 3:2 
 



pgsql-hackers by date:

Previous
From: Christopher Kings-Lynne
Date:
Subject: Weird locking situation
Next
From: Rod Taylor
Date:
Subject: Re: Thoughts on maintaining 7.3