RE: A few misc. questions. - Mailing list pgsql-admin

From Nicolas Huillard
Subject RE: A few misc. questions.
Date
Msg-id 01BFC6FA.9F7FCDE0@agen.int.ghs
Whole thread Raw
In response to A few misc. questions.  ("Rainer Mager" <rmager@vgkk.com>)
List 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,
andhaven'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'tknow 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
notsync'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
"vacuumanalyze;"' 
**************************************
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


pgsql-admin by date:

Previous
From: Reiner Dassing
Date:
Subject: Re: Scheduling Database Tasks
Next
From: Norbert Meissner
Date:
Subject: Bug or Feature ?