Lists: | pgsql-general |
---|
From: | "Jason Long" <jason(at)supernovasoftware(dot)com> |
---|---|
To: | <pgsql-general(at)postgresql(dot)org> |
Subject: | information_schema._pg_keypositions() in 8.1??? |
Date: | 2005-12-01 17:42:48 |
Message-ID: | 20051201174314.887B4F0B9C@svr2.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
I cannot get automatic schema update to work in 8.1 with hibernate 3.0.5. I
get the following error every time.
java.sql.SQLException: ERROR: function information_schema._pg_keypositions()
does not exist
Is this something I should be looking to fix with Hibernate or PostgreSQL?
Any assistance would be greatly appreciated.
Thank you for your time,
Jason Long
CEO and Chief Software Engineer
BS Physics, MS Chemical Engineering
http://www.supernovasoftware.com
From: | "Jason Long" <jason(at)supernovasoftware(dot)com> |
---|---|
To: | <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: information_schema._pg_keypositions() in 8.1??? |
Date: | 2005-12-01 19:10:18 |
Message-ID: | 20051201191034.11C329DD639@postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
Executing the following from "information_schema.sql" from the 8.0
distribution against the restored database in 8.1 solved the problem. Is
this a bug?
*****************************************************************
SET search_path TO information_schema, public;
/*
* A few supporting functions first ...
*/
/* This returns the integers from 1 to INDEX_MAX_KEYS/FUNC_MAX_ARGS */
CREATE FUNCTION _pg_keypositions() RETURNS SETOF integer
LANGUAGE sql
IMMUTABLE
AS 'select g.s
from generate_series(1,current_setting(''max_index_keys'')::int,1)
as g(s)';
Thank you for your time,
Jason Long
CEO and Chief Software Engineer
BS Physics, MS Chemical Engineering
http://www.supernovasoftware.com
_____
From: pgsql-general-owner(at)postgresql(dot)org
[mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of Jason Long
Sent: Thursday, December 01, 2005 11:43 AM
To: pgsql-general(at)postgresql(dot)org
Subject: [GENERAL] information_schema._pg_keypositions() in 8.1???
I cannot get automatic schema update to work in 8.1 with hibernate 3.0.5. I
get the following error every time.
java.sql.SQLException: ERROR: function information_schema._pg_keypositions()
does not exist
Is this something I should be looking to fix with Hibernate or PostgreSQL?
Any assistance would be greatly appreciated.
Thank you for your time,
Jason Long
CEO and Chief Software Engineer
BS Physics, MS Chemical Engineering
http://www.supernovasoftware.com
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | jason(at)supernovasoftware(dot)com |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: information_schema._pg_keypositions() in 8.1??? |
Date: | 2005-12-01 19:24:23 |
Message-ID: | 16008.1133465063@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
"Jason Long" <jason(at)supernovasoftware(dot)com> writes:
> I cannot get automatic schema update to work in 8.1 with hibernate 3.0.5. I
> get the following error every time.
> java.sql.SQLException: ERROR: function information_schema._pg_keypositions()
> does not exist
Hm, it looks like some bright soul at Hibernate decided to depend on an
undocumented internal function :-(
> Is this something I should be looking to fix with Hibernate or PostgreSQL?
Hibernate. As a short term workaround you could manually create the
function using the 8.0 definition, which is
/* This returns the integers from 1 to INDEX_MAX_KEYS/FUNC_MAX_ARGS */
CREATE FUNCTION information_schema._pg_keypositions() RETURNS SETOF integer
LANGUAGE sql
IMMUTABLE
AS 'select g.s
from generate_series(1,current_setting(''max_index_keys'')::int,1)
as g(s)';
Note that one reason this went away in 8.1 is that there no longer is a
hard upper limit to the number of function arguments, so depending on
what Hibernate is expecting it to do, you might have some issues ...
regards, tom lane
From: | Kris Jurka <books(at)ejurka(dot)com> |
---|---|
To: | Jason Long <jason(at)supernovasoftware(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: information_schema._pg_keypositions() in 8.1??? |
Date: | 2005-12-01 20:36:45 |
Message-ID: | Pine.BSO.4.61.0512011535550.18909@leary.csoft.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
On Thu, 1 Dec 2005, Jason Long wrote:
> I cannot get automatic schema update to work in 8.1 with hibernate 3.0.5. I
> get the following error every time.
>
> java.sql.SQLException: ERROR: function information_schema._pg_keypositions()
> does not exist
>
This is actually a sign that you are using an 8.0 jdbc driver against an
8.1 server. You need the 8.1 driver.
Kris Jurka