Re: Accessing schema data in information schema

Поиск
Список
Период
Сортировка
От Christopher Kings-Lynne
Тема Re: Accessing schema data in information schema
Дата
Msg-id 4422235A.9050404@calorieking.com
обсуждение исходный текст
Ответ на Re: Accessing schema data in information schema  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
> Hm, good point.  We could put 'em in pg_sequence, except that most of
> the operations on pg_sequence rows will be nontransactional, and that
> doesn't seem to square nicely with transactional updates on ACLs.
> Maybe we need two catalogs just to separate the transactional and
> nontransactional data for a sequence?  Ugh.

Is it possible to have an SRF that can peek into the lastval data and 
present it, and make no changes to our catalogs at all?

Or can't we use in the schema view something like:

CREATE VIEW sequences AS  SELECT CAST(current_database() AS sql_identifier) AS sequence_catalog,
CAST(nc.nspnameAS sql_identifier) AS sequence_schema,         CAST(c.relname AS sql_identifier) AS sequence_name,
 (SELECT seq_info('sequence_name', 'max')) AS maximum_value,         (SELECT seq_info('sequence_name', 'min')) AS
minimum_value,        (SELECT seq_info('sequence_name', 'inc')) AS increment,         (SELECT seq_info('sequence_name',
'cycle'))AS cycle_option  FROM pg_namespace nc, pg_class c  WHERE c.relnamespace = nc.oid        AND c.relkind = 's';
 

Chris



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Accessing schema data in information schema
Следующее
От: Tom Lane
Дата:
Сообщение: Re: create type error message