From: Peter Eisentraut <e99re41@DoCS.UU.SE>
To: Rainer Mager <rmager@vgkk.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: A few misc. questions.
Date: Fri, 26 May 2000 16:15:31 +0200 (MET DST)
Message-ID: <Pine.GSO.4.02A.10005261604400.12244-100000@Falk.DoCS.UU.SE> (raw)
In-Reply-To: <NEBBJBCAFMMNIHGDLFKGGEALCCAA.rmager@vgkk.com>
On Fri, 26 May 2000, Rainer Mager wrote:
> 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?
If you are talking about serial values, then you'll get an error.
Otherwise it's of course up to you what you do with your primary keys.
Eventually we'll move to int8 for serial probably.
> 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.
Again, what you do with your primary keys is up to you. Ideally you won't
need to retrieve the primary key value because you know what you just
inserted. If you are talking about serial, then the answer is there isn't
one because serial isn't SQL. But as someone already said, the curval
function will do.
> 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?
For backup use pg_dump, for synchronization you're currently out of luck.
> 4. Does anyone have any advice on how often to run VACUUM? Any rules of
> thumb, etc?
If there's a lot of write activity in your database, nightly might be a
good idea. Otherwise less often.
--
Peter Eisentraut Sernanders väg 10:115
peter_e@gmx.net 75262 Uppsala
http://yi.org/peter-e/ Sweden
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: e99re41@DoCS.UU.SE, rmager@vgkk.com
Subject: Re: A few misc. questions.
In-Reply-To: <Pine.GSO.4.02A.10005261604400.12244-100000@Falk.DoCS.UU.SE>
References: <NEBBJBCAFMMNIHGDLFKGGEALCCAA.rmager@vgkk.com> <Pine.GSO.4.02A.10005261604400.12244-100000@Falk.DoCS.UU.SE>
* 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