#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2009
    Posts
    3
    Rep Power
    0

    Post Length() is not working on postgres 9.2


    Hello,

    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.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Oct 2003
    Location
    Germany
    Posts
    2,788
    Rep Power
    349
    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 06:44 AM.
    I will not read nor answer questions where the SQL code is messy and not formatted properly using [code] tags.
    http://forums.devshed.com/misc.php?do=bbcode#code

    Tips on how to ask better questions:
    http://tkyte.blogspot.de/2005/06/how-to-ask-questions.html
    http://wiki.postgresql.org/wiki/SlowQueryQuestions
    http://catb.org/esr/faqs/smart-questions.html
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2009
    Posts
    3
    Rep Power
    0

    Thanks a Lot


    Hey shammat,

    Thanks a lot
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2009
    Posts
    3
    Rep Power
    0

    Thanks a Lot


    Hey shammat,

    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.

IMN logo majestic logo threadwatch logo seochat tools logo