Re: A table with two names or table alias

Поиск
Список
Период
Сортировка
От Igor Neyman
Тема Re: A table with two names or table alias
Дата
Msg-id F4C27E77F7A33E4CA98C19A9DC6722A2033A7FAA@EXCHANGE.corp.perceptron.com
обсуждение исходный текст
Ответ на A table with two names or table alias  (Tk421 <vrobador@gmail.com>)
Список pgsql-sql
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



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

Предыдущее
От: Emi Lu
Дата:
Сообщение: Re: Query prepared plan
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Query prepared plan