dbTalk Databases Forums  

WARNING: column "footype" has type "unknown"

comp.databases.postgresql.general comp.databases.postgresql.general


Discuss WARNING: column "footype" has type "unknown" in the comp.databases.postgresql.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ed L.
 
Posts: n/a

Default WARNING: column "footype" has type "unknown" - 10-27-2004 , 06:01 PM







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?

Ed


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly


Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: WARNING: column "footype" has type "unknown" - 10-27-2004 , 06:24 PM






"Ed L." <pgsql (AT) bluepolka (DOT) net> writes:
Quote:
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

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match



Reply With Quote
  #3  
Old   
Ed L.
 
Posts: n/a

Default Re: WARNING: column "footype" has type "unknown" - 10-27-2004 , 06:34 PM



On Wednesday October 27 2004 5:24, Tom Lane wrote:
Quote:
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
Is that 8.0 you're working against there? Here's my 7.4.6 installation:

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

$ psql -c "select * from fooview"
footype
---------
bar
(1 row)



---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)



Reply With Quote
  #4  
Old   
Ed L.
 
Posts: n/a

Default Re: WARNING: column "footype" has type "unknown" - 10-27-2004 , 06:36 PM



On Wednesday October 27 2004 5:34, Ed L. wrote:
Quote:
On Wednesday October 27 2004 5:24, Tom Lane wrote:
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

Is that 8.0 you're working against there? Here's my 7.4.6 installation:

$ psql -c "select * from fooview"
Ah, sorry. Just noticed the "distinct". Thanks.

Ed


---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.