Proposal: variant of regclass
От | Tatsuo Ishii |
---|---|
Тема | Proposal: variant of regclass |
Дата | |
Msg-id | 20131205.093704.2163427111196453284.t-ishii@sraoss.co.jp обсуждение исходный текст |
Ответы |
Re: Proposal: variant of regclass
|
Список | pgsql-hackers |
I would like to propose to add a variant of regclass. Background: Pgpool-II (http://www.pgpool.net) needs to get information of tables by querying PostgreSQL's system catalog. For efficiency and correctness of the info (search path consideration), pgpool-II issues such queries piggy packing the user's connection to PostgreSQL and regclass is frequently used in the queries. One problem with stock regclass is, it raises exception when a target tables is not found, which breaks user's transaction currently running on the session. For a workaround, pgpool-II ships non-error-raising version of regclass, called pgpool_regclass. However it's not perfect solution because people (or even distributions/packagers) forget to install it [1]. Another problem is, pgpool_regclass heavily depends on the internals of PostgreSQL, which has been changed version to versions and pgpool developers need to spend some efforts to adopt the changes. Someone suggested before that pgpool_regclass could be implemented as a pl function, but I think it is unacceptable because 1) the function is heavily used and using pl will cause performance problem, 2) it does solve the problem I said in [1]. Proposal: I would like to add a variant of regclass, which is exactly same as current regclass except it does not raise an error when the target table is not found. Instead it returns InvalidOid (0). Pgpool-II is being shipped with various distributions and used by many companies including EnterpriseDB, VMWare, SRA OSS and so on. IMO this small enhancement will benefit many PostgreSQL users by small changes to PostgreSQL. -- Tatsuo Ishii SRA OSS, Inc. Japan English: http://www.sraoss.co.jp/index_en.php Japanese: http://www.sraoss.co.jp
В списке pgsql-hackers по дате отправления: