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.
In response to
pgsql-jdbc by date
|Next:||From: Oliver Jowett||Date: 2004-09-23 00:26:27|
|Subject: Re: raising the default prepareTheshold|
|Previous:||From: Kris Jurka||Date: 2004-09-22 19:50:46|
|Subject: Re: Problem linking Postgresql JDBC driverb and Matlab (Linux)|