Thread: Pb with Spring & Metadat

Pb with Spring & Metadat

From
TNO
Date:
Hello,

I want to get database information using metadata with Spring (1.2.4).
It's OK with postGre8.0, but when I use postGre8.1, error...

what about this function "information_schema._pg_keypositions()" ?

Caused by: org.springframework.jdbc.support.MetaDataAccessException:
Error while extracting DatabaseMetaData; nested exception is
org.postgresql.util.PSQLException: ERROR: function
information_schema._pg_keypositions() does not exist
   at
org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:180)

   at
arc.bd.spring.service.TableService.fillRelation1_1(TableService.java:181)
   ... 4 more
Caused by: org.postgresql.util.PSQLException: ERROR: function
information_schema._pg_keypositions() does not exist
   at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1471)

   at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1256)

   at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:175)

   at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:389)

   at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:314)

   at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:221)

   at
org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData.getImportedExportedKeys(AbstractJdbc2DatabaseMetaData.java:3237)

   at
org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData.getImportedKeys(AbstractJdbc2DatabaseMetaData.java:3533)

   at
arc.bd.spring.callback.ImportedKeyInfo.processMetaData(ImportedKeyInfo.java:28)

   at
org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:174)

   ... 5 more

--
Il n'y a pas de mauvais langage, il n'y a que des bons programmeurs



Re: Pb with Spring & Metadat

From
Kris Jurka
Date:

On Thu, 9 Feb 2006, TNO wrote:

> Hello,
>
> I want to get database information using metadata with Spring (1.2.4).
> It's OK with postGre8.0, but when I use postGre8.1, error...
>
> what about this function "information_schema._pg_keypositions()" ?
>
> org.postgresql.util.PSQLException: ERROR: function
> information_schema._pg_keypositions() does not exist
>   at

If you're going to use a 8.1 server you need the 8.1 driver as well.

Kris Jurka


Re: Pb with Spring & Metadat

From
tnodev
Date:
I have both postgre8.0 and 8.1 on my station.
8.0 on port 5432 and 8.1 on port 54321

when I use pg8.0 and driver postgresql-8.0-315.jdbc3.jar, works fine...
when I use pg8.1 and driver postgresql-8.1-404.jdbc3.jar error !

here's the full trace

arc.bd.service.exception.ArcException:
org.springframework.jdbc.support.MetaDataAccessException: Error while
extracting DatabaseMetaData; nested exception is
org.postgresql.util.PSQLException: ERROR: function
information_schema._pg_keypositions() does not exist
    at
arc.bd.spring.service.TableService.fillRelation1_1(TableService.java:194)
    at arc.bd.spring.service.TableService.fillTable(TableService.java:107)
    at arc.bd.spring.service.TableService.getTablePg(TableService.java:67)
    at
arc.bd.spring.service.TestTableService.testTableService(TestTableService.java:15)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 ...
    at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: org.springframework.jdbc.support.MetaDataAccessException:
Error while extracting DatabaseMetaData; nested exception is
org.postgresql.util.PSQLException: ERROR: function
information_schema._pg_keypositions() does not exist
    at
org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:180)
    at
arc.bd.spring.service.TableService.fillRelation1_1(TableService.java:181)
    ... 18 more
Caused by: org.postgresql.util.PSQLException: ERROR: function
information_schema._pg_keypositions() does not exist
    at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1471)
    at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1256)
    at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:175)
    at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:389)
    at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:314)
    at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:221)
    at
org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData.getImportedExportedKeys(AbstractJdbc2DatabaseMetaData.java:3237)
    at
org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData.getImportedKeys(AbstractJdbc2DatabaseMetaData.java:3533)
    at
arc.bd.spring.callback.ImportedKeyInfo.processMetaData(ImportedKeyInfo.java:28)
    at
org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:174)
    ... 19 more




Kris Jurka a écrit :

>
>
> On Thu, 9 Feb 2006, TNO wrote:
>
>> Hello,
>>
>> I want to get database information using metadata with Spring (1.2.4).
>> It's OK with postGre8.0, but when I use postGre8.1, error...
>>
>> what about this function "information_schema._pg_keypositions()" ?
>>
>> org.postgresql.util.PSQLException: ERROR: function
>> information_schema._pg_keypositions() does not exist
>>   at
>
>
> If you're going to use a 8.1 server you need the 8.1 driver as well.
>
> Kris Jurka
>
>
>
>


Re: Pb with Spring & Metadat

From
Kris Jurka
Date:

On Fri, 10 Feb 2006, tnodev wrote:

> I have both postgre8.0 and 8.1 on my station.
> 8.0 on port 5432 and 8.1 on port 54321
>
> when I use pg8.0 and driver postgresql-8.0-315.jdbc3.jar, works fine...
> when I use pg8.1 and driver postgresql-8.1-404.jdbc3.jar error !
>

You are mistaken about what version of the driver you are using with 8.1.
The stacktrace confirms that you are using an 8.0 driver.

Kris Jurka


Re: Pb with Spring & Metadat

From
TNO
Date:
My Eclipse classpath show me 8.1 driver...

Kris Jurka a écrit :

>
>
> On Fri, 10 Feb 2006, tnodev wrote:
>
>> I have both postgre8.0 and 8.1 on my station.
>> 8.0 on port 5432 and 8.1 on port 54321
>>
>> when I use pg8.0 and driver postgresql-8.0-315.jdbc3.jar, works fine...
>> when I use pg8.1 and driver postgresql-8.1-404.jdbc3.jar error !
>>
>
> You are mistaken about what version of the driver you are using with
> 8.1. The stacktrace confirms that you are using an 8.0 driver.
>
> Kris Jurka
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>
>
>

--
Il n'y a pas de mauvais langage, il n'y a que des bons programmeurs



Re: Pb with Spring & Metadat

From
Markus Schaber
Date:
Hi, TNO,

TNO wrote:
> My Eclipse classpath show me 8.1 driver...

Are you shure that you don't have the 8.0 driver deployed into the jdk
ext directory, or somewhere else where it is found by the jdk?

Can you place
            System.err.println(org.postgresql.Driver.getVersion());
into your application to see which driver version it loads?

HTH,
Markus
--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org

Re: Pb with Spring & Metadat

From
Kris Jurka
Date:

On Mon, 13 Feb 2006, Markus Schaber wrote:

> TNO wrote:
>> My Eclipse classpath show me 8.1 driver...
>
>            System.err.println(org.postgresql.Driver.getVersion());

or better yet,

System.err.println(org.postgresql.util.PSQLDriverVersion.main());

This will print out where it has found the driver as well as what version
it has found.

Kris Jurka


Re: Pb with Spring & Metadat

From
TNO
Date:
Seems good...  ;-)

PostgreSQL 8.1devel JDBC3 with SSL (build 400)
Found in:
jar:file:/C:/eclipse3.1/Java/Jar/postgresql-8.1dev-400.jdbc3.jar!/org/postgresql/Driver.class



Kris Jurka a écrit :

>
>
> On Mon, 13 Feb 2006, Markus Schaber wrote:
>
>> TNO wrote:
>>
>>> My Eclipse classpath show me 8.1 driver...
>>
>>
>>            System.err.println(org.postgresql.Driver.getVersion());
>
>
> or better yet,
>
> System.err.println(org.postgresql.util.PSQLDriverVersion.main());
>
> This will print out where it has found the driver as well as what
> version it has found.
>
> Kris Jurka
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>
>
>

--
Il n'y a pas de mauvais langage, il n'y a que des bons programmeurs



Re: Pb with Spring & Metadat

From
Kris Jurka
Date:

On Mon, 13 Feb 2006, TNO wrote:

> Seems good...  ;-)
>
> PostgreSQL 8.1devel JDBC3 with SSL (build 400)
> Found in:
>

Earlier you claimed to have build 404, but you've only got 400.  This
problem was fixed in build 401.  Please upgrade.

Kris Jurka

Re: Pb with Spring & Metadat

From
Markus Schaber
Date:
Hi, TNO,

TNO wrote:
> Seems good...  ;-)
>
> PostgreSQL 8.1devel JDBC3 with SSL (build 400)
> Found in:
> jar:file:/C:/eclipse3.1/Java/Jar/postgresql-8.1dev-400.jdbc3.jar!/org/postgresql/Driver.class

Doesn't seem so good, as you're using a prerelease version.

Try to get 8.1 build 405 from http://jdbc.postgresql.org/download.html
and see if the problem persists.

HTH,
Markus
--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org

Re: Pb with Spring & Metadat

From
Markus Schaber
Date:
Hi, Kris,

Kris Jurka wrote:

>> TNO wrote:
>>
>>> My Eclipse classpath show me 8.1 driver...
>>
>>
>>            System.err.println(org.postgresql.Driver.getVersion());
>
>
> or better yet,
>
> System.err.println(org.postgresql.util.PSQLDriverVersion.main());
>
> This will print out where it has found the driver as well as what
> version it has found.

Oh, great tool. However, it does not work this way. You have to call
  org.postgresql.util.PSQLDriverVersion.main(args)
with args being a String array, and don't wrap it into
System.err.println, as it returns void.

HTH,
Markus


--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org

Re: Pb with Spring & Metadat

From
TNO
Date:
Works fine , thanks a lot

PostgreSQL 8.1 JDBC3 with SSL (build 404)
Found in: jar:file:/C:/eclipse3.1/Java/Jar/postgresql-8.1-404.jdbc3.jar!/org/postgresql/Driver.class


Markus Schaber a écrit :
Hi, TNO,

TNO wrote: 
Seems good...  ;-)

PostgreSQL 8.1devel JDBC3 with SSL (build 400)
Found in:
jar:file:/C:/eclipse3.1/Java/Jar/postgresql-8.1dev-400.jdbc3.jar!/org/postgresql/Driver.class   
Doesn't seem so good, as you're using a prerelease version.

Try to get 8.1 build 405 from http://jdbc.postgresql.org/download.html
and see if the problem persists.

HTH,
Markus 

-- 
Il n'y a pas de mauvais langage, il n'y a que des bons programmeurs