November 28th, 2012, 04:56 AM
Length() is not working on postgres 9.2
I have two server windows and linux. postgres 8.0 is installed on my linux server and postgres 9.2 is installed on my windows server. I have transferred my current database which is installed on linux server(postgres 8.0) to windows. after transferred some of function is not working on postgres 9.2. LENGTH is not working for integer or numeric values but it is working well for strings.
for the example
select (length('employee'); = 8 is working but
select (length(12000); is not working.
would you please help me to solve this issue. waiting for your reply.
Thanks in Advance.
November 28th, 2012, 05:40 AM
length() is only defined for character values.
One major change in 8.3 was to remove many of the implicit data type conversions (if you hadn't waited that long to upgrade you'd noticed earlier )
The best way to fix this, is to make sure you are calling the function with the correct data type.
See the release notes for more details: http://www.postgresql.org/docs/8.3/static/release-8-3.html#AEN87992
Last edited by shammat; November 28th, 2012 at 05:44 AM.
I will not read nor answer questions where the SQL code is messy and not formatted properly using [code] tags.
Tips on how to ask better questions:
November 28th, 2012, 06:17 AM
Thanks a Lot
Thanks a lot
November 28th, 2012, 06:18 AM
Thanks a Lot
My company will not allow me to upgrade the postgres. I don't know why but they want to stuck on the old version . by the way Thanks a lot for your valuable reply.