bogus tsdict, tsparser, etc object identities - Mailing list pgsql-hackers

From Alvaro Herrera
Subject bogus tsdict, tsparser, etc object identities
Date
Msg-id 20140409220328.GZ5822@eldon.alvh.no-ip.org
Whole thread Raw
Responses Re: bogus tsdict, tsparser, etc object identities  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
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

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PATCH] Negative Transition Aggregate Functions (WIP)
Next
From: Alvaro Herrera
Date:
Subject: Re: Per table autovacuum vacuum cost limit behaviour strange