Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 01 Oct 2008 08:32:16 -0600
Bill Thoen <bthoen@xxxxxxxxxx> 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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux