{"record":{"id":"30416b209ba1a6ff","repo":"hibernate/hibernate-orm","slug":"postgresql-only-supports-ref-cursor-parameters-as-30416b","errorCode":null,"errorMessage":"PostgreSQL only supports REF_CURSOR parameters as the first parameter","messagePattern":"PostgreSQL only supports REF_CURSOR parameters as the first parameter","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLDialect.java","lineNumber":1177,"sourceCode":"\t@Override\n\tpublic boolean supportsUnboundedLobLocatorMaterialization() {\n\t\treturn false;\n\t}\n\n\t@Override\n\tpublic SelectItemReferenceStrategy getGroupBySelectItemReferenceStrategy() {\n\t\treturn SelectItemReferenceStrategy.POSITION;\n\t}\n\n\t@Override\n\tpublic CallableStatementSupport getCallableStatementSupport() {\n\t\treturn PostgreSQLCallableStatementSupport.INSTANCE;\n\t}\n\n\t@Override\n\tpublic ResultSet getResultSet(CallableStatement statement, int position) throws SQLException {\n\t\tif ( position != 1 ) {\n\t\t\tthrow new UnsupportedOperationException( \"PostgreSQL only supports REF_CURSOR parameters as the first parameter\" );\n\t\t}\n\t\treturn (ResultSet) statement.getObject( 1 );\n\t}\n\n\t@Override\n\tpublic ResultSet getResultSet(CallableStatement statement, String name) throws SQLException {\n\t\tthrow new UnsupportedOperationException( \"PostgreSQL only supports accessing REF_CURSOR parameters by position\" );\n\t}\n\n\t@Override\n\tpublic boolean qualifyIndexName() {\n\t\treturn false;\n\t}\n\n\t@Override\n\tpublic IdentityColumnSupport getIdentityColumnSupport() {\n\t\treturn PostgreSQLIdentityColumnSupport.INSTANCE;\n\t}","sourceCodeStart":1159,"sourceCodeEnd":1195,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLDialect.java#L1159-L1195","documentation":"Error \"PostgreSQL only supports REF_CURSOR parameters as the first parameter\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Triggered when the application calls a Hibernate dialect feature that the configured database dialect cannot provide: PostgreSQL only supports REF_CURSOR parameters as the first parameter.","commonSituations":"Common when running against a database whose dialect lacks this capability, when a mapping or HQL/Criteria query requests unsupported functionality, or when the wrong dialect is configured for the database in use. Error: PostgreSQL only supports REF_CURSOR parameters as the first parameter.","solutions":["Declare the REF_CURSOR parameter as the first procedure parameter.","Restructure the procedure call so the cursor comes first."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}