473,388 Members | 1,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

WARNING: column "footype" has type "unknown"


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 ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #1
3 6610
"Ed L." <pg***@bluepolka.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

---------------------------(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

Nov 23 '05 #2
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 "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 ma*******@postgresql.org)

Nov 23 '05 #3
On Wednesday October 27 2004 5:34, Ed L. wrote:
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

Nov 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Liam3 | last post by:
I'm having a problem with a table that accidently had a column added whose type is the same as the table. This is seriously creating a problem as I cannot delete the table and I really don't have...
1
by: Oliver | last post by:
Hello ! Can anyone reproduce this? I am using WinXP SP1 (MDAC 2.8) with MSVS 2003. I can create a complete database with ADOX and everything works, however if I try to add a Datatype adBoolean...
1
by: jmarr02s | last post by:
I am trying to change my Amount column Data Type from Integer to Decimal (precision 9 digits, scale 3, that is 6 digits to the left of decimal and 3 digits to the right of decimal. Here is the...
0
by: Daniel | last post by:
how does ado.net SqlDataReader.GetString() know which encoding to read the data into a string as? Does sql sever set this at the column data type level, server wide encoding setting, os encoding?
2
by: bogie | last post by:
Hello I have some problem to change my column data type in my table property from character(15) to character(100). I use Postgresql 7.4. The problem is I try to make new column with...
5
by: =?Utf-8?B?TWlrZSBPS0M=?= | last post by:
How do I get the width of a column using Type Datasets? I don't want to know the length of the data in the column, I want to know the width of the column. In my code, if the column width is 50...
3
bartonc
by: bartonc | last post by:
Is it possible to select a column of type INTEGER PRIMARY KEY without knowing its name? This also happens to be column zero in all my tables. I've played with lots of different syntaxes, to no avail....
12
by: elliot.li.tech | last post by:
Hello everyone, I'm migrating a C++ program from 32-bit systems to 64-bit systems. The old programmers used some annoying assignments like assigning "long" to "int", which may lead to data loss....
2
by: Chandan Kr Sah | last post by:
How to write sql query to create column of type Yes/No with checkbox.By default it is creating with textbox. I am struglling for the same from one week. So plese provide me any solution for the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.