Обсуждение: bogus tsdict, tsparser, etc object identities

Поиск
Список
Период
Сортировка

bogus tsdict, tsparser, etc object identities

От
Alvaro Herrera
Дата:
I noticed that pg_identify_object() gives a bogus answer for the text
search object types: it is failing to schema-qualify the objects.  I
guess at the time I thought that those object types were global, not
contained within schemas (as seems reasonable.  Who would want to have
different text search parsers in different schemas anyway?)

alvherre=# CREATE TEXT SEARCH DICTIONARY alt_ts_dict1 (template=simple);
CREATE TEXT SEARCH DICTIONARY
alvherre=# create schema foo;
CREATE SCHEMA
alvherre=# CREATE TEXT SEARCH DICTIONARY foo.alt_ts_dict1 (template=simple);
CREATE TEXT SEARCH DICTIONARY

Before patch,

alvherre=# select identity.* from pg_ts_dict, pg_identify_object('pg_ts_dict'::regclass, oid, 0) identity where schema
<>'pg_catalog'; 
          type          | schema |     name     |   identity
------------------------+--------+--------------+--------------
 text search dictionary | public | alt_ts_dict1 | alt_ts_dict1
 text search dictionary | foo    | alt_ts_dict1 | alt_ts_dict1
(2 filas)

After patch,

alvherre=# select identity.* from pg_ts_dict, pg_identify_object('pg_ts_dict'::regclass, oid, 0) identity where schema
<>'pg_catalog'; 
          type          | schema |     name     |      identity
------------------------+--------+--------------+---------------------
 text search dictionary | public | alt_ts_dict1 | public.alt_ts_dict1
 text search dictionary | foo    | alt_ts_dict1 | foo.alt_ts_dict1
(2 filas)

This problem is new in 9.3, so backpatching to that.  Prior to that we
didn't have object identities.

The attached patch demonstrates the fix for tsdict only, but as I said
above all text search object types are affected, so I'm going to
backpatch for all of them.

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Вложения

Re: bogus tsdict, tsparser, etc object identities

От
Alvaro Herrera
Дата:
Alvaro Herrera wrote:

> This problem is new in 9.3, so backpatching to that.  Prior to that we
> didn't have object identities.

Done.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services