Re: Solution for Synonyms

From: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Thomas Kellerer *EXTERN*" <spam_eater(at)gmx(dot)net>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Solution for Synonyms
Date: 2013-11-25 10:10:29
Message-ID: A737B7A37273E048B164557ADEF4A58B17C5F8E3@ntex2010i.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thomas Kellerer wrote:
> mrprice22 wrote on 22.11.2013 19:25:
>> We are in the process of moving from Oracle to PostgreSQL. We use a stored
>> procedure to populate some reporting tables once an hour. There are two
>> sets of these tables, set A and set B. We use synonyms to point to the
>> “active” set of tables at any given time.
>>
>> The procedure works like this:
>>
>> 1. If set A tables are “active” truncate set B tables or if set A tables are
>> “active” truncate set B tables.
>> 2. Populate set B tables.
>> 3. Set synonyms to point to set B tables.
>>
>> How might I accomplish the same thing in PostgreSQL?
>
> You can use a view

You can also keep the tables A and B in different schemas
(probably a good idea anyway) and change search_path on the client side.

Yours,
Laurenz Albe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2013-11-25 13:35:13 Re: [GENERAL] pg_upgrade ?deficiency
Previous Message 邓尧 2013-11-25 09:59:20 Re: Weird "function does not exist" error.