Fix pgstattuple/pgstatindex to use regclass-type as the argument

Поиск
Список
Период
Сортировка
От Satoshi Nagayasu
Тема Fix pgstattuple/pgstatindex to use regclass-type as the argument
Дата
Msg-id 5132EED7.9060304@uptime.jp
обсуждение исходный текст
Ответы Re: Fix pgstattuple/pgstatindex to use regclass-type as the argument  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi,

As I wrote before, I'd like to clean up pgstattuple functions to
allow the same expressions.

Re: [HACKERS] [RFC] pgstattuple/pgstatindex enhancement
http://www.postgresql.org/message-id/511EE19B.5010004@uptime.jp

My goal is to allow specifying a relation/index with several
expressions, 'relname', 'schemaname.relname' and oid in all
pgstattuple functions. pgstatindex() does not accept oid so far.

I have found that the backward-compatibility can be kept
when the arguments (text and/or oid) are replaced with regclass
type. regclass type seems to be more appropriate here.

So, I cleaned up those three functions, pgstattuple(), pgstatindex(),
pg_relpages(), to accept a regclass-type argument, instead of using
text and/or oid type, as the test cases show.

 select * from pgstatindex('test_pkey');
 select * from pgstatindex('public.test_pkey');
 select * from pgstatindex('myschema.test_pkey');
 select * from pgstatindex('myschema.test_pkey'::regclass::oid);

With attached patch, all functions in the pgstattuple module can
accept the same expression to specify the target relation/index.

Any comments or suggestions?

Regards,
--
Satoshi Nagayasu <snaga@uptime.jp>
Uptime Technologies, LLC. http://www.uptime.jp

Вложения

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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: scanner/parser minimization
Следующее
От: Dean Rasheed
Дата:
Сообщение: Re: Materialized views WIP patch