Skip site navigation (1) Skip section navigation (2)

Re: CREATE SYNONYM ...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
Cc: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>, "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>, Hans-J?rgen Sch?nig <postgres(at)cybertec(dot)at>, Michael Glaesemann <grzm(at)myrealbox(dot)com>, pgsql-patches(at)postgresql(dot)org, eg(at)cybertec(dot)at
Subject: Re: CREATE SYNONYM ...
Date: 2006-03-07 22:14:48
Message-ID: 5861.1141769688@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-patches
Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com> writes:
> On Tue, 7 Mar 2006, Jim C. Nasby wrote:
>> Wouldn't the cost only be incurred if you searched for something in
>> pg_class that wasn't there, and therefor had to fall back to pg_synonym?

> I think if synonyms were search path dependant that wouldn't be true since
> you'd need to know if there was a synonym that shadowed another item.

Right, and that's exactly why I complained.  Even if pg_synonym is
empty, it takes nonzero effort to find that out.

One reason I like the alternative of putting synonym entries into the
regular catalogs is that it eliminates the need for extra searches:
you'd make exactly the same searches as you did before.  Now, to the
extent that this requires making catalog entries longer, there'd be a
distributed overhead that might partially cancel that out --- but I
don't see any reason that the entries have to get longer for regular
tables.  The link field could be a nullable field at the end, and
the flag that it's a synonym would just be another relkind value.

I don't think the case for pg_proc synonyms has been made adequately at
all, so I'd personally just blow off that part of the proposal.  There's
no real cost to just making another copy of the proc.

(Actually, I don't think the case for table synonyms has been made
adequately either; "Oracle has it" is *not* enough reason to take on
another feature that we'll have to maintain forever, especially given
that we're being told that one of the major use-cases for synonyms
isn't going to be supported.  AFAICS this patch does nothing you
couldn't do much better with a quick search-and-replace over your
application code.  In short, I remain unsold.)

			regards, tom lane

In response to

Responses

pgsql-patches by date

Next:From: Alvaro HerreraDate: 2006-03-07 22:28:40
Subject: Re: CREATE SYNONYM ...
Previous:From: Stephan SzaboDate: 2006-03-07 21:43:50
Subject: Re: CREATE SYNONYM ...

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group