Re: Fw: postgresql experts please help

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: Fw: postgresql experts please help
Дата
Msg-id Pine.BSO.4.64.0710181340270.25640@leary.csoft.net
обсуждение исходный текст
Ответ на Re: Fw: postgresql experts please help  (Mark Lewis <mark.lewis@mir3.com>)
Ответы Re: Fw: postgresql experts please help  (Mark Lewis <mark.lewis@mir3.com>)
Список pgsql-jdbc

On Thu, 18 Oct 2007, Mark Lewis wrote:

> You haven't disabled JDBC autocommit for this connection.  That means
> that each statement gets executed in a separate transaction.
>
> Since currval is only valid within the scope of a single transaction,
> and you're executing your "select currval" from a separate transaction,
> that's why you can't see it.
>

False.  currval maintains state across transactions:

jurka=# create sequence myseq;
CREATE SEQUENCE
jurka=# begin;
BEGIN
jurka=# select nextval('myseq');
  nextval
---------
        1
(1 row)

jurka=# commit;
COMMIT
jurka=# select currval('myseq');
  currval
---------
        1
(1 row)


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

Предыдущее
От: Mark Lewis
Дата:
Сообщение: Re: Fw: postgresql experts please help
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: Fw: postgresql experts please help