Results 1 to 3 of 3

Thread: JdbcUsersConnectionRepository together with Postgres 8.4, function ifnull not found.

Hybrid View

  1. #1
    Join Date
    Aug 2008
    Location
    odessa.ua
    Posts
    26

    Default JdbcUsersConnectionRepository together with Postgres 8.4, function ifnull not found.

    Hi guys,
    I'm using spring social version 1.0.0.M3.
    Trying to use JdbcUsersConnectionRepository together with Postgres 8.4.

    Here is exception I'm getting:
    org.springframework.web.util.NestedServletExceptio n: Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [(select ifnull(max(rank) + 1, 1) as rank from UserConnection where userId = ? and providerId = ?)]; nested exception is org.postgresql.util.PSQLException: ERROR: function ifnull(integer, integer) does not exist
    Hint: No function matches the given name and argument types. You might need to add explicit type casts.

  2. #2
    Join Date
    Aug 2008
    Location
    odessa.ua
    Posts
    26

    Default

    as far as i know there's COALESCE function in PostgreSQL that does similar to IFNULL

  3. #3
    Join Date
    Aug 2008
    Location
    odessa.ua
    Posts
    26

    Default

    i can add stored procedure like
    CREATE OR REPLACE FUNCTION IFNULL (anyelement, anyelement) RETURNS anyelement AS
    'SELECT COALESCE($1, $2) AS result'
    LANGUAGE 'sql';
    is there any way to avoid that?
    Last edited by kolodrevskiy; May 14th, 2011 at 05:00 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •