RE: A few misc. questions.

From: Nicolas Huillard <nhuillard(at)ghs(dot)fr>
To: "'Rainer Mager'" <rmager(at)vgkk(dot)com>, "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: RE: A few misc. questions.
Date: 2000-05-26 08:10:29
Message-ID: 01BFC6FA.9F7FCDE0@agen.int.ghs
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

1. using unsigned int(4), it will take 137 years, inserting one record a second, to reach MAXINT. That's not an issue, and haven't been handled.

2. Use the curval() function, which returns exactly what you want, and is far better than reading the sequence table (I don't know if it's standard : check the doc)

3. The only way is to pg_dump/pg_dump_all. Don't rely on backing up the database's files : they're almost in-memory and not sync'ed.
Postgres 7.0 has a query logging facility. Maybe someone can explain if it can be used as a replication tool ?

4. Daily, using this little script (/etc/cron.daily/postgresql) :
**************************************
#!/bin/sh

su postgres -c 'psql -t -c "select datname from pg_database order by datname;" template1 | xargs -n 1 psql -q -c "vacuum analyze;"'
**************************************
Maybe it is integrated in the 7.0 RPM ? If not, I think it should.

Nicolas Huillard

-----Message d'origine-----
De: Rainer Mager [SMTP:rmager(at)vgkk(dot)com]
Date: vendredi 26 mai 2000 01:46
À: pgsql-admin(at)postgresql(dot)org
Objet: [ADMIN] A few misc. questions.

Hi all,

I have a few miscellaneous questions. If anyone has any ideas I'd
appreciate hearing them.

1. What happens when the primary key index runs out. That is, if we use an
INT(4) for a key and we create and delete enough to reach that number then
what happens?

2. Does anyone one know a standard SQL method (that works with Postgres) to
retrieve the primary key of a newly INSERTed record? We've found one way but
it will not work with order databases since it relies on reading data from
the sequence tables.

3. Does anyone know of any way to perform a database backup/synchronization
that somehow does its work when the database is otherwise not busy? Which is
preferred, backing up the PG files or doing some sort of sync?

4. Does anyone have any advice on how often to run VACUUM? Any rules of
thumb, etc?

Thanks,

--Rainer

Browse pgsql-admin by date

  From Date Subject
Next Message Peter Eisentraut 2000-05-26 14:15:31 Re: A few misc. questions.
Previous Message Reiner Dassing 2000-05-26 06:56:17 Re: Scheduling Database Tasks