<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Forum PostgreSQL - Select nextval współbieżnie]]></title>
	<link rel="self" href="http://forum.postgresql.org.pl/extern.php?action=feed&amp;tid=506&amp;type=atom"/>
	<updated>2010-11-22T19:23:19Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.postgresql.org.pl/viewtopic.php?id=506</id>
		<entry>
			<title type="html"><![CDATA[Odp: Select nextval współbieżnie]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=2280#p2280"/>
			<content type="html"><![CDATA[No fakt chyba jakiś bug.
Czy nałożenie na kolumnę Id wartości domyślnej nextval('referral_for_examination_id_seq') i pominięcie tej kolumny przy INSERT'ach nie rozwiązuje problemu?]]></content>
			<author>
				<name><![CDATA[rski]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=26</uri>
			</author>
			<updated>2010-11-22T19:23:19Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=2280#p2280</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Select nextval współbieżnie]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=2279#p2279"/>
			<content type="html"><![CDATA[Witam,

W wersji 8.4 podczas testów wydajnościowych zauważyliśmy dziwne zachowanie. 
Wbrew definicji działania funkcji nextval otrzymujemy tą samą sekwnecję.

Dwa wątki w odzielnych transakcjach równocześnie próbuja dodać nową krotkę.. niestety kończy się to naruszeniem integralności bazy.

nextval zwraca dwa razy wartość 42400...

Pomysły ?

2010-11-22 12:50:41 CET LOG:  execute <unnamed>: select nextval ('referral_for_examination_id_seq') 
2010-11-22 12:50:41 CET LOG:  execute <unnamed>: select nextval ('referral_for_examination_id_seq') 
2010-11-22 12:50:41 CET LOG:  execute <unnamed>: insert into RFE_REFERALLS_FOR_EXAMINATION (CREATE_DATE, DOCTOR_ID, INSTITUTION_ID, LABORATORY_ID, PATIENT_ID, READY, REFERRAL_CODE, VALUEABLE_CLINIC_INFO, Id) values ($1, $2, $3, $4, $5, $6, $7, $8, $9) 
2010-11-22 12:50:41 CET DETAIL:  parameters: $1 = '2010-11-22 12:51:06.472', $2 = '1173', $3 = '1249', $4 = NULL, $5 = '12', $6 = 'f', $7 = '1249-0100000012', $8 = 'tutaj dane istotne klinicznie', $9 = '42400' 
2010-11-22 12:50:41 CET LOG:  execute <unnamed>: insert into RFE_REFERALLS_FOR_EXAMINATION (CREATE_DATE, DOCTOR_ID, INSTITUTION_ID, LABORATORY_ID, PATIENT_ID, READY, REFERRAL_CODE, VALUEABLE_CLINIC_INFO, Id) values ($1, $2, $3, $4, $5, $6, $7, $8, $9) 
2010-11-22 12:50:41 CET DETAIL:  parameters: $1 = '2010-11-22 12:51:06.486', $2 = '1173', $3 = '1249', $4 = NULL, $5 = '13', $6 = 'f', $7 = '1249-0000000013', $8 = 'tutaj dane istotne klinicznie', $9 = '42400']]></content>
			<author>
				<name><![CDATA[xautu]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=1167</uri>
			</author>
			<updated>2010-11-22T15:14:35Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=2279#p2279</id>
		</entry>
</feed>
