Re: information_schema._pg_keypositions() in 8.1???

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: information_schema._pg_keypositions() in 8.1???
Дата
Msg-id 16008.1133465063@sss.pgh.pa.us
обсуждение исходный текст
Ответ на information_schema._pg_keypositions() in 8.1???  ("Jason Long" <jason@supernovasoftware.com>)
Список pgsql-general
"Jason Long" <jason@supernovasoftware.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

В списке pgsql-general по дате отправления:

Предыдущее
От: "Jason Long"
Дата:
Сообщение: Re: information_schema._pg_keypositions() in 8.1???
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: interval behaviour