bogus tsdict, tsparser, etc object identities

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: bogus tsdict, tsparser, etc object identities
Date: 2014-04-09 22:03:28
Message-ID: 20140409220328.GZ5822@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
qualify-tsobjs.patch text/x-diff 1.1 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2014-04-09 22:10:33 Re: Per table autovacuum vacuum cost limit behaviour strange
Previous Message Tom Lane 2014-04-09 21:55:16 Re: [PATCH] Negative Transition Aggregate Functions (WIP)