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

[GENERAL] Administration Documentation....

2003-07-01 Thread Benjamin Jury
Good day, Just printed out all 198 pages of the Administrators Guide which is at http://www.postgresql.com/docs/pdf/7.3/admin-7.3.2-A4.pdf only to find the index is full of question marks where page numbers should be!!! (Well not all granted, but about 95% are!) Arg! ---(e

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.3&idoc=0&fil > e=ddl-alter.html > > IIRC it was introduced fairly recently (7.3?) Doh! Really should get rid of 'Practical Post

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 > > whic

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

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