Re: Broken pg_class table

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

 



Sorry, should have been more specific.
Version 8.1.0

update statement called from a bash script where $tbl is table name and $sch is schema name

update pg_class set reltriggers =
(select count(*) from pg_trigger where tgrelid =
(select oid from pg_class where relname = '$tbl' and relnamespace =
(select oid from pg_namespace where nspname = '$sch')))--should have been a limiting where clause here


Thanks,

Roger

Tom Lane wrote:
Roger Ging <roger@xxxxxxxxxxxxxxxx> writes:
  
I accidentally wrecked the pg_class table in a database by leaving off 
the where clause of an update statement when setting the reltriggers 
back to the count from pg_trigger after a bulk data load.
    

What was the *exact* update statement, and which PG version is this?

			regards, tom lane
  

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux