Re: CREATE SYNONYM suggestions
От | Marc Lavergne |
---|---|
Тема | Re: CREATE SYNONYM suggestions |
Дата | |
Msg-id | 3D40738E.6@richlava.com обсуждение исходный текст |
Ответ на | Re: CREATE SYNONYM suggestions (Peter Eisentraut <peter_e@gmx.net>) |
Ответы |
Re: CREATE SYNONYM suggestions
|
Список | 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@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. >
В списке pgsql-hackers по дате отправления: