Re: [SQL] VACUUM not doing its job?

2002-08-03 Thread Kristian Eide
> You should also search the archives for threads on free space maps. You > most likely need to increase yours. In particular, see: >http://archives.postgresql.org/pgsql-general/2002-07/msg00972.php Thanks, very helpful, although there does not seem to be much description of what the two free

Re: [SQL] VACUUM not doing its job?

2002-08-03 Thread Kristian Eide
> In my case, it was the fact that indexes don't release the space of > indexes of deleted rows. So, if you have a table that has a lot of > inserts/deletes, your indexes will grow incredibly fast. > > The way to see what your biggest items are: > select * from pg_class order by relpages desc; Y

[SQL] Bug with dump/restore when using UNION and ORDER BY in views

2002-08-03 Thread Kristian Eide
There seems to be a bug when dumping a view which is a UNION of selects, one of which has an ORDER BY. A pair of paranthesises around the select is missing, and this cause a subsequent restore to fail. This is quite annoying as the backup file must be manually edited before it can be restored, and

[SQL] VACUUM not doing its job?

2002-08-03 Thread Kristian Eide
Hi, I have a PostgreSQL 7.2.1 database which normally (just after a pg_restore) takes about 700-800MB of disk space. Now, the problem is that the database grows quite quickly when in use, although we don't put very much data in. Granted, there is quite a few records deleted and inserted, but the t

Re: [SQL] Rule WHERE condition problem

2002-07-09 Thread Kristian Eide
>> ERROR: query rewritten 10 times, may contain cycles >> It would seem that my WHERE clause is not checked before the action is run. >No, the WHERE clause is essentially transformed into part of the rule >query. You can't ever write a rule of the form > ON UPDATE TO b DO UPDATE b ... >bec

[SQL] Rule WHERE condition problem

2002-07-08 Thread Kristian Eide
I have a table with a reference constraint and an ON DELETE SET NULL action. When this action triggers, I also want to update another field in the table, actually a timestamp which should be set to NOW(). After reading some documentation it would seem a rule is the easiest way to accomplish this.