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

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: Auto-increment serial (Postgresql JDBC driver w/
Дата
Msg-id Pine.BSO.4.56.0409221454160.32134@leary.csoft.net
обсуждение исходный текст
Ответ на Re: Auto-increment serial (Postgresql JDBC driver w/  ("Jaroslaw J. Pyszny" <arghil@poczta.onet.pl>)
Ответы Re: Auto-increment serial (Postgresql JDBC driver w/
Список 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


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

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: Problem linking Postgresql JDBC driverb and Matlab (Linux)
Следующее
От: Oliver Jowett
Дата:
Сообщение: Re: raising the default prepareTheshold