Re: [GENERAL] Monthly table partitioning for fast purges?

2003-08-04 Thread Benjamin Jury
You could create an index on the function date(), which strips the time information. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 04 August 2003 14:01 To: PgSQL General ML Subject: Re: [GENERAL] Monthly table partitioning for fast purges? I am

Re: [GENERAL] adding fields to a table

2003-06-27 Thread Benjamin Jury
However you cannot currently remove a column... Oh yes you can: ALTER TABLE tbl DROP COLUMN whatever http://www.postgresql.org/docs/view.php?version=7.3idoc=0fil e=ddl-alter.html IIRC it was introduced fairly recently (7.3?) Doh! Really should get rid of 'Practical PostgreSQL' as

FW: [GENERAL] INSERT WHERE NOT EXISTS

2003-06-26 Thread Benjamin Jury
// check if entry already exists SELECT COUNT(*) FROM tablename WHERE [cond] .. if($count 0) UPDATE else INSERT but this will double the hit to the database server, because for every operation I need to do SELECT COUNT(*) first. The data itself is not a lot, and the condition

FW: [GENERAL] Foreign keys

2003-06-26 Thread Benjamin Jury
I have foreign keys set up so that if, for example, a record in customer is deleted, the corresponding records in the customer_addresses table are also removed. However, I can't find a way of ensuring records in the address table are deleted too, given that lots of different tables will

Re: [GENERAL] adding fields to a table

2003-06-26 Thread Benjamin Jury
I have a table with a bunch of records already inserted. When I want to add or remove fields from the, what I've done is produce an sql file, add the fields to the create table directive, and add the fields manually to each record to be inserted. Then I do an \i db_name which