Skip site navigation (1) Skip section navigation (2)

Re: Auto-increment serial (Postgresql JDBC driver w/

From: Kris Jurka <books(at)ejurka(dot)com>
To: "Jaroslaw J(dot) Pyszny" <arghil(at)poczta(dot)onet(dot)pl>
Cc: pg(at)fastcrypt(dot)com, pgsql-jdbc <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Auto-increment serial (Postgresql JDBC driver w/
Date: 2004-09-22 19:59:30
Message-ID: Pine.BSO.4.56.0409221454160.32134@leary.csoft.net (view raw or flat)
Thread:
Lists: pgsql-jdbc

On Wed, 22 Sep 2004, Jaroslaw J. Pyszny wrote:

> W liƛcie z sro, 22-09-2004, godz. 00:50, Dave Cramer pisze: 
> > Sorry, missed one more where clause.
> > 
> > select column_default from information_schema.columns where table_name =
> > 'xyz' and column_name = 'id';
> > 
> > This assumes a table defined like create table xyz (id serial);
> It's works but only for the owner of the table
> or I do something wrong ;)
> 

The information_schema takes into account permissions on objects and 
doesn't show things you can't access.  So in this case a GRANT SELECT ON 
<table> TO <user> would make it show up.  This seems OK because to get a 
ResultSet you clearly have to be able to query the table.

The problem I came across was that if you only grant access to the table
it doesn't propagate to the underlying sequence.  So if a user doesn't
have permissions to use the sequence it doesn't show up as the default in
the information_schema view.  I'm leaning towards believing this is a bug 
in the information_schema, but it just seems safer to use the direct 
catalog access method you wrote.

Kris Jurka


In response to

Responses

pgsql-jdbc by date

Next:From: Oliver JowettDate: 2004-09-23 00:26:27
Subject: Re: raising the default prepareTheshold
Previous:From: Kris JurkaDate: 2004-09-22 19:50:46
Subject: Re: Problem linking Postgresql JDBC driverb and Matlab (Linux)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group