Re: Another proposal for table synonyms

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: Another proposal for table synonyms
Дата
Msg-id 4CF6AC6F.3050908@agliodbs.com
обсуждение исходный текст
Ответ на Re: Another proposal for table synonyms  (Alexey Klyukin <alexk@commandprompt.com>)
Ответы Re: Another proposal for table synonyms  ("Joshua D. Drake" <jd@commandprompt.com>)
Re: Another proposal for table synonyms  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-hackers
> 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.

(IMHO, the main reason why Oracle has synonyms is that their
implementation of SCHEMA is broken.)

There are two more arguments for table synonyms:

1. to support application versioning with an easier syntax than
updatable views.

2. to provide an alternative to the difficult-to-manage search_path

However, the latter does mean that there needs to be a fixed
order-of-resolution for synonyms which conflict with the name of objects
in other schema.  And one which doesn't break backwards compatiblity.

I'd love to hear from someone at EDB: how are you dealing with synonym
name collisions right now?

> Is this the feature the community would benefit from? We can consider adding
> column synonyms if we won't hardwire synonyms to pg_class objects.

Actually, we'd just put that one in pg_attribute.  I worked out a
back-of-the-napkin design, and it wouldn't require any new tables.  A
new column, yes.  But no new catalog tables.

So, I don't support your idea of having a completely separate catalog.
Sorry.

The use case for simple column synonyms is supporting application
versioning by allowing changes to column names without needing to
refactor all applications.  Later, we could also implement "calculated
columns" where the synonym points to an expression rather than a direct
column link.  All sorts of use cases for that.

--                                  -- Josh Berkus                                    PostgreSQL Experts Inc.
                        http://www.pgexperts.com
 


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Alexey Klyukin
Дата:
Сообщение: Re: Another proposal for table synonyms
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Idle git question: how come so many "objects"?