Skip site navigation (1) Skip section navigation (2)

Re: minor view creation weirdness

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: PostgreSQL hackers list <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: minor view creation weirdness
Date: 2003-10-02 09:33:05
Message-ID: 1065087185.2921.42.camel@linda.lfix.co.uk (view raw or flat)
Thread:
Lists: pgsql-hackers
On Thu, 2003-10-02 at 08:40, Greg Stark wrote:
> Neil Conway <neilc(at)samurai(dot)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(dot)Elphick(at)lfix(dot)co(dot)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 


In response to

pgsql-hackers by date

Next:From: Harald FuchsDate: 2003-10-02 12:19:08
Subject: Strange behavior regarding temporary sequences
Previous:From: Christopher Kings-LynneDate: 2003-10-02 08:29:14
Subject: Weird locking situation

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group