Re: CREATE SYNONYM suggestions

From: Marc Lavergne <mlavergne-pub(at)richlava(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: CREATE SYNONYM suggestions
Date: 2002-07-25 21:54:22
Message-ID: 3D40738E.6@richlava.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Like you said, it's really just a symlink for db objects. If memory
serves me right, synonyms can only refer to tables and views in Oracle.
The most common use is for simplifying access to objects outside your
schema (eg. create synonym TABLEX for JOHN.TABLEX) or for simplifying
access to objects across database links (eg. create synonym TABLEX for
TABLEX(at)DBY).

Quick note: I know that PostgreSQL doesn't have the same concept of
schemas, this is just an example.

There are two types of synonyms, private and public. Public synonyms
only exist within the current user's schema while public synonyms apply
system wide to all users.

From a PostgreSQL perspective, there is little *current* value that
synonyms bring to the table, save for reducing an object name like
THIS_IS_WAY_TOO_LONG to TOO_LONG. That said, it's still a very commonly
used construct in other commercial DBMSs.

I guess the place to implement this would be somewhere shortly after the
parser has done it's thing, probably as part of the OID resolution. I
should make this my standard disclaimer ;-) but again ... my goal with
all this Oracle compatibility stuff is the SQL*Net compatibility listed
in the TODO.

Peter Eisentraut wrote:
> Marc Lavergne writes:
>
>
>>The question is, since CREATE SYNONYM appears to be a SQL extension, is
>>this something the group would want to incorporate?
>
>
> Well, you could start by explaining what exactly this concept is and what
> it would be useful for. I imagine that it is mostly equivalent to
> symlinks. If so, I can see a use for it, but it would probably have to be
> a separate type of object altogether, so you could also create
> synonyms/symlinks to functions, types, etc.
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2002-07-26 00:03:04 CREATE CONVERSION/DROP CONVERSION implemented
Previous Message Hannu Krosing 2002-07-25 21:16:10 Re: CREATE SYNONYM suggestions