[GENERAL] pl/pgsql loop thru columns names

2009-08-18 Thread Dilyan Berkovski
Hi All, I have a nasty table with many repeating columns of the kind port_ts_{i}_, where {i} is from 0 to 31, and could be 3 different words. I have made a pl/pgsql function that checks those columns from port_ts_1_status to port_ts_31_status and counts something, however this is nasty and ugl

[GENERAL] inherit table and its data

2008-11-17 Thread Dilyan Berkovski
hi All, I am using PostgreSQL 8.2, and I am interested in creating a table B that inherits table A, but with all it's data! create table B {a int} inherits A, just adds the structure of table A, not its data. Is it possible to do this without the classic way - trigger on table A so each inse