RE: [INTERFACES] locking on database updates

Поиск
Список
Период
Сортировка
От Gary Stainburn
Тема RE: [INTERFACES] locking on database updates
Дата
Msg-id 01BF40AD.8CF130C0@garys.ringways.co.uk
обсуждение исходный текст
Список pgsql-interfaces
-----Original Message-----
From:    Douglas Thomson [SMTP:dougt@mugc.cc.monash.edu.au]
Sent:    Tuesday, December 07, 1999 11:16 AM
To:    Gary Stainburn
Subject:    Re: [INTERFACES] locking on database updates

!> Is there any way to easily retrieve the sequence number just created =
!> without having the same contension problems I originally wanted to =
!> avoid?
!
!Do you need to find out the next value that will be used before you
!use it? If so there may be a problem...
!
!However, if you only need to do inserts and find out afterwards what
!sequence number got used then there is no problem. Postgres looks
!after making sure multiple simultaneous backend processes don't
!duplicate sequence numbers. I think it actually reserves a few
!numbers in the sequence for each process, so it is possible to get
!small gaps in the sequence, or for the sequence numbers to be not
!strictly chronological...
!
!As for the how - well, I simply selected back the row I had just
!inserted to extract the sequence number column :-)
!
!Doug.

It's not important that I know the number beforehand.  However, as 
this is the only field that is guaranteed to be unique, getting the 
sequence number using  a select statement may not work.
It doesn't matter
-----------------------------------------
Gary Stainburn.
Work: http://www.ringways.co.uk gary.stainburn@ringways.co.uk
REVCOM: http://www.revcom.dhs.org http://www.revcom.org.uk gary.stainburn@revcom.org.uk
-----------------------------------------
The nice thing about standards is that there are so many of them to choose from. -- Andrew S. Tanenbaum
-----------------------------------------



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

Предыдущее
От: Karel Zak - Zakkr
Дата:
Сообщение: Re: [INTERFACES] Spanish format on date and numbers
Следующее
От: Gary Stainburn
Дата:
Сообщение: RE: [INTERFACES] locking on database updates