working with sequences

Поиск
Список
Период
Сортировка
От Alex Ott
Тема working with sequences
Дата
Msg-id ht2u1t2ssvo.fsf@seal.service.jet.msk.su
обсуждение исходный текст
Ответы Re: working with sequences  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
Hello

I have some troubles when work with sequences. I porting code from oracle
to pgsql, adding suppport for new database.

I start one big transaction where i insert many records in various tables.
Most of inserts look like:

insert into rfc822_address (id, addr_spec, personal, adl, error)        values (nextval('rfc822_address_seq'), ?, ?, ?,
?)

and after insert i need get current value of sequence
'rfc822_address_seq'. I do this with

select currval('rfc822_addr_spec_seq')

but sometimes this query return none and my programm crash. This offten
happen after 2-3 call of nextval

Is anybody can help me?

-- 
With best wishes, Alex Ott                            Jet Infosystems




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

Предыдущее
От: "Christopher Kings-Lynne"
Дата:
Сообщение: Re: How to merge several attributes and Delete an attribute
Следующее
От: Tod McQuillin
Дата:
Сообщение: Re: How to merge several attributes and Delete an attribute