Announcement Announcement Module
Collapse
No announcement yet.
JdbcUsersConnectionRepository together with Postgres 8.4, function ifnull not found. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    as far as i know there's COALESCE function in PostgreSQL that does similar to IFNULL

    Comment


    • #3
      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, 05:00 PM.

      Comment

      Working...
      X