Skip site navigation (1) Skip section navigation (2)

Re: A table with two names or table alias

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: A table with two names or table alias
Date: 2008-07-25 12:23:50
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql
am  Fri, dem 25.07.2008, um 14:12:47 +0200 mailte Tk421 folgendes:
>    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.

You can create a VIEW, and if you want to insert data into the view, you
can create rules for that.

Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA

In response to

pgsql-sql by date

Next:From: Milan OparnicaDate: 2008-07-25 12:58:34
Subject: Re: PERSISTANT PREPARE (another point of view)
Previous:From: Tk421Date: 2008-07-25 12:12:47
Subject: A table with two names or table alias

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group