Re: Another proposal for table synonyms

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, Alexey Klyukin <alexk(at)commandprompt(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Another proposal for table synonyms
Date: 2010-12-03 00:10:48
Message-ID: AANLkTikpca2Mk72mnbgHTrpB7ztO9PEck0iNE-FKBzfU@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Dec 2, 2010 at 3:43 PM, Alvaro Herrera
<alvherre(at)commandprompt(dot)com> wrote:
> Excerpts from Robert Haas's message of jue dic 02 17:27:01 -0300 2010:
>> On Wed, Dec 1, 2010 at 3:55 PM, Alvaro Herrera
>> <alvherre(at)commandprompt(dot)com> wrote:
>> > Excerpts from Josh Berkus's message of mié dic 01 17:13:35 -0300 2010:
>> >>
>> >> > Well, porting applications from other database systems that support synonyms
>> >> > (i.e. Oracle, DB2, SQL Server).
>> >>
>> >> SQL Server supports synonyms?  If it's not Oracle-only, it's a more
>> >> powerful argument to have the feature.
>> >
>> > I think it's worth mentioning that in SQL Server, synonyms are not
>> > schema-qualified; they're "global" objects.
>>
>> Seems like they have more than one kind.
>>
>> http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_7001.htm
>
> Yeah, the Oracle system is a lot more complex than SQL Server's, but I
> was only talking about the latter, for which see here:
>
> http://www.databasejournal.com/features/mssql/article.php/3635426/SYNONYM-in-SQL-Server-2005.htm

Well, that seems primarily designed to cut down on three and four part
names. We don't have that problem anyway.

>> The list of objects for which they support synonyms is also
>> interesting.
>
> The bit that allows a synonym to reference another synonym seems like
> worth considering further (either reject them altogether, or have some
> way to deal with possible cycles).

It's pretty trivial to do cycle-detection at runtime.

> I think the original proposal in
> this thread didn't mention them at all.
>
> (I don't think we should consider synonyms for either functions or
> stored procedures; that would make the current mess of function
> resolution rules a lot messier.)

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-12-03 00:12:16 Re: Spread checkpoint sync
Previous Message Robert Haas 2010-12-03 00:06:29 Re: crash-safe visibility map, take three