Re: A few misc. questions.

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: A few misc. questions.
Дата
Msg-id Pine.GSO.4.02A.10005261604400.12244-100000@Falk.DoCS.UU.SE
обсуждение исходный текст
Ответ на A few misc. questions.  ("Rainer Mager" <rmager@vgkk.com>)
Ответы Re: A few misc. questions.  (Ragnar Kjørstad <postgres@ragnark.vestdata.no>)
Список pgsql-admin
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


В списке pgsql-admin по дате отправления:

Предыдущее
От: Karel Zak
Дата:
Сообщение: Re: Bug or Feature ?
Следующее
От: "Vladimir V. Zolotych"
Дата:
Сообщение: password