There are no synonyms in Postgres (like in Oracle).
To implement what you want, you need to use views and rules.
From Postgres docs:
"Currently, views are read only: the system will not allow an insert,
update, or delete on a view. You can get the effect of an updatable view
by creating rules that rewrite inserts, etc. on the view into
appropriate actions on other tables."
Read docs on views and rules.
HTH,
Igor
-----Original Message-----
From: pgsql-sql-owner@postgresql.org
[mailto:pgsql-sql-owner@postgresql.org] On Behalf Of Tk421
Sent: Friday, July 25, 2008 8:13 AM
To: pgsql-sql@postgresql.org
Subject: [SQL] A table with two names or table alias
Can I create a table name alias?
What i want is to access the same table with two different names. An
example:
I've the table CITY with fields code and name. I want to know if i
can create an alternative name to table CITY, like LOCATION, to make
possible these two sentences:
insert into CITY values (10, 'New York'); insert into LOCATION values (11, 'Paris')
Thank you.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make
changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql