Re: Another proposal for table synonyms - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Another proposal for table synonyms
Date
Msg-id 27415.1291134532@sss.pgh.pa.us
Whole thread Raw
In response to Another proposal for table synonyms  (Alexey Klyukin <alexk@commandprompt.com>)
Responses Re: Another proposal for table synonyms
List pgsql-hackers
Alexey Klyukin <alexk@commandprompt.com> writes:
> To support addition of new database objects types that can be referenced by
> synonyms a new system catalog, pg_synonym, is to be added, with an oid to
> support comments on synonym, and the following schema:

This is not going to work, at least not without making every type of
lookup consult pg_synonym too, which I think can be considered DOA
because of its performance impact on people who aren't even using the
feature.  It's also quite unclear how you prevent duplicate names
if the synonyms are in their own catalog.  (And no, the part of your
proposal that says you're not preventing that isn't acceptable from
a usability standpoint.)

You could reasonably support synonyms for tables/views by storing them
in pg_class with a new relkind.  This doesn't cover synonyms for other
object types, but since the total world demand for such a feature is
approximately zero, that's not really a problem.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: crash-safe visibility map, take three
Next
From: Heikki Linnakangas
Date:
Subject: Re: crash-safe visibility map, take three