From: Nicolas Huillard <nhuillard@ghs.fr>
To: 'Rainer Mager' <rmager@vgkk.com>
To: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: RE: A few misc. questions.
Date: Fri, 26 May 2000 10:10:29 +0200
Message-ID: <01BFC6FA.9F7FCDE0@agen.int.ghs> (raw)
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@vgkk.com]
Date: vendredi 26 mai 2000 01:46
À: pgsql-admin@postgresql.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: nhuillard@ghs.fr, rmager@vgkk.com
Subject: Re: A few misc. questions.
In-Reply-To: <01BFC6FA.9F7FCDE0@agen.int.ghs>
References: <01BFC6FA.9F7FCDE0@agen.int.ghs>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox