Re: WARNING: column "footype" has type "unknown"

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Ed L(dot)" <pgsql(at)bluepolka(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: WARNING: column "footype" has type "unknown"
Date: 2004-10-27 23:24:51
Message-ID: 25817.1098919491@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Ed L." <pgsql(at)bluepolka(dot)net> writes:
> On 7.4.6, is there any problem with defining one column of a view to be a
> string literal? For example ...

> $ psql -c "create view fooview as select 'bar' as footype"
> WARNING: column "footype" has type "unknown"
> DETAIL: Proceeding with relation creation anyway.
> CREATE VIEW

> Or is this warning just noise in this case?

Depending on what you expect to do with the view, you'd probably be
better off casting the literal to some specific type, perhaps text
or varchar. An example of what you won't be able to do:

regression=# select distinct * from fooview;
ERROR: failed to find conversion function from "unknown" to text

I think there was some discussion in the past of forcing the view column
to text type, but evidently nothing's been done about it yet.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ed L. 2004-10-27 23:34:47 Re: WARNING: column "footype" has type "unknown"
Previous Message Mariusz Czułada 2004-10-27 23:24:06 Creating schema copy