Re: minor view creation weirdness

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: minor view creation weirdness
Date: 2003-10-02 14:16:30
Message-ID: 26846.1065104190@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Neil Conway <neilc(at)samurai(dot)com> writes:
> Is this a bug?

> nconway=# create view baz (a,b) as select 'hello', 'world';
> WARNING: column "a" has type "unknown"
> DETAIL: Proceeding with relation creation anyway.

It's always done that, although the spelling of the notice has
varied over the years.

These days we tend to force "unknown" to become "text" if a specific
data type is really required, and I suppose a case could be made that
CREATE VIEW should do that too. But the consequences of guessing wrong
are probably worse here than elsewhere, since you can't really change
the view column type short of dropping and recreating the view.

I'd almost argue that we should change this message to an error:

ERROR: column "a" has type "unknown"
HINT: Explicitly cast the string literal to some specific type.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-10-02 14:30:58 Re: Weird locking situation
Previous Message Seun Osewa 2003-10-02 12:31:52 Re: Possible Commit Syntax Change for Improved TPS