pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedInformation about the command SQL " create synonym".
4+ messages / 4 participants
[nested] [flat]
* Information about the command SQL " create synonym".
@ 2004-10-12 13:04 Gerald.Laurent@bull.net
0 siblings, 2 replies; 4+ messages in thread
From: Gerald.Laurent@bull.net @ 2004-10-12 13:04 UTC (permalink / raw)
To: pgsql-sql
Hello !
I am trying to find some informations about the SQL command "create
synonym".
The command "create synonym" does not exit in the Postgres database.
I had tested with the latest version (postgres8.0 beta3) and this command
is not present.
I supposed that this command "create synnonym" is an extention of the SQL92
on the other database like Oracle, Informix etc..
Could you say if this command will be implemanted in a future version of a
postgres database ?
Best regards.
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Information about the command SQL " create synonym".
@ 2004-10-12 17:37 Peter Eisentraut <peter_e@gmx.net>
parent: Gerald.Laurent@bull.net
1 sibling, 0 replies; 4+ messages in thread
From: Peter Eisentraut @ 2004-10-12 17:37 UTC (permalink / raw)
To: Gerald.Laurent@bull.net; pgsql-sql
Gerald.Laurent@bull.net wrote:
> Could you say if this command will be implemanted in a future version
> of a postgres database ?
I'm not currently aware of any concrete proposals to implement this
feature, but previous discussion has not shown any strong resistance
against the concept.
--
Peter Eisentraut
http://developer.postgresql.org/~petere/
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Information about the command SQL " create synonym".
@ 2005-02-03 19:48 Philip Patterson <philip.patterson@gmail.com>
parent: Gerald.Laurent@bull.net
1 sibling, 1 reply; 4+ messages in thread
From: Philip Patterson @ 2005-02-03 19:48 UTC (permalink / raw)
To: Gerald.Laurent@bull.net <Gerald.Laurent@bull.net>; pgsql-sql
On Tue, 12 Oct 2004 15:04:14 +0200, Gerald.Laurent@bull.net
<Gerald.Laurent@bull.net> wrote:
> Hello !
>
> I am trying to find some informations about the SQL command "create
> synonym".
>
> The command "create synonym" does not exit in the Postgres database.
>
> I had tested with the latest version (postgres8.0 beta3) and this command
> is not present.
>
> I supposed that this command "create synnonym" is an extention of the SQL92
> on the other database like Oracle, Informix etc..
>
> Could you say if this command will be implemanted in a future version of a
> postgres database ?
>
> Best regards.
>
>
Hi Gerald.
Much like yourself, I have been searching for a way to create synonyms
in Postgres. I think that I have found a hack / solution to our
problem. Please bare in mind that I have not had an opportunity to
fully test this from every angle, but the basics of SELECT, INSERT,
UPDATE, and DELETE all work just fine.
What I did, was to make use of the Postgres inheritance feature. The
documentation's example uses this to create a new table that adds a
new column/field to an existing table. However it seems quite happy
to let you inherit without changing the structure of the original
table at all. This in turn effectively creates an alias.
For example, if you create a table as follows ...
CREATE TABLE foo (bar int not null);
but you need a synonym called "gerald", then you could do the following ...
CREATE TABLE gerald () INHERITS (foo);
You can now use the object "gerald" to do everything (that I tried)
you want with "foo".
I would love to hear from the developers, or other gurus, if there are
any serious issues with doing this. Will it create any serious
performance problems, or will there be functionality gaps between a
real table and an inherited table that might limit the usefulness of
this workaround?
Best of luck,
Philip
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Information about the command SQL " create synonym".
@ 2005-02-03 20:04 Karsten Hilbert <Karsten.Hilbert@gmx.net>
parent: Philip Patterson <philip.patterson@gmail.com>
0 siblings, 0 replies; 4+ messages in thread
From: Karsten Hilbert @ 2005-02-03 20:04 UTC (permalink / raw)
To: pgsql-sql
> Much like yourself, I have been searching for a way to create synonyms
> in Postgres. I think that I have found a hack / solution to our
> problem.
...
> What I did, was to make use of the Postgres inheritance feature.
> This in turn effectively creates an alias:
> CREATE TABLE foo (bar int not null);
>
> but you need a synonym called "gerald", then you could do the following ...
>
> CREATE TABLE gerald () INHERITS (foo);
> I would love to hear from the developers, or other gurus, if there are
> any serious issues with doing this.
Primary keys and foreign keys will likely show unexpected
behaviour (as in being out of sync between foo and gerald and
any other "alias" child tables of foo).
Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2005-02-03 20:04 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-10-12 13:04 Information about the command SQL " create synonym". Gerald.Laurent@bull.net
2004-10-12 17:37 ` Peter Eisentraut <peter_e@gmx.net>
2005-02-03 19:48 ` Philip Patterson <philip.patterson@gmail.com>
2005-02-03 20:04 ` Karsten Hilbert <Karsten.Hilbert@gmx.net>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox