"object references" and renaming was: Why Does UPDATE Take So Long?

From: Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it>
To: pgsql-general(at)postgresql(dot)org
Subject: "object references" and renaming was: Why Does UPDATE Take So Long?
Date: 2008-10-01 14:52:11
Message-ID: 20081001165211.086aa6a6@dawn.webthatworks.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 01 Oct 2008 08:32:16 -0600
Bill Thoen <bthoen(at)gisnet(dot)com> wrote:

> CREATE TABLE farm2 (LIKE farms);
> INSERT INTO farm2 (farm_id, fips_cd, farm_nbr, prog_year) SELECT
> farm_id, fips_cd, farm_nbr, '2007' FROM farms;
> DROP TABLE farms;
> ALTER TABLE farm2 RENAME TO farms;
> CREATE UNIQUE INDEX farms_id_key ON farms(farm_id);
> CREATE UNIQUE INDEX farms_fips_nbr_key ON farms(fips_cd,farm_nbr);

Is this kind of stuff going to affect any reference to the farm
table? eg. inside functions, triggers etc?
what if:
create table farm_rel (
farm_id [sometype] references farm(farm_id) on delete cascade,
...
);

and I

alter table farm rename to farm_t;
alter table farm2 rename to farm;
drop table farm_t;

or similar situations...

where could I incur in troubles using RENAME (for tables, columns
etc...)?

thanks

--
Ivan Sergio Borgonovo
http://www.webthatworks.it

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Monnerie 2008-10-01 14:54:23 Re: [GENERAL] 8.3.4 rpms for Opensuse10.3 64bit
Previous Message Bill Thoen 2008-10-01 14:32:16 Re: Why Does UPDATE Take So Long?