<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Forum PostgreSQL - Jak pominąć błąd "duplicate key value violates unique constraint"?]]></title>
	<link rel="self" href="http://forum.postgresql.org.pl/extern.php?action=feed&amp;tid=1863&amp;type=atom"/>
	<updated>2013-06-28T16:51:08Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.postgresql.org.pl/viewtopic.php?id=1863</id>
		<entry>
			<title type="html"><![CDATA[Odp: Jak pominąć błąd "duplicate key value violates unique constraint"?]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=4624#p4624"/>
			<content type="html"><![CDATA[[code]
ALTER TABLE tourney_hand_player_combinations DROP CONSTRAINT tourney_hand_player_combinations_primary_key 
[/code]

Wystarczyło wiedzieć, że primary key można zdjąć :D]]></content>
			<author>
				<name><![CDATA[fryzurka]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=1605</uri>
			</author>
			<updated>2013-06-28T16:51:08Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=4624#p4624</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Jak pominąć błąd "duplicate key value violates unique constraint"?]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=4623#p4623"/>
			<content type="html"><![CDATA[Hej

Jestem lalikiem jeżeli chodzi IT. Chciałem to zaznaczyć już na początku ;)

Musze wykonać w bazie PostgreSQL'a to:

[code]
UPDATE tourney_hand_player_combinations SET id_player = 19580 WHERE id_player != 19580 AND id_player != 1 AND id_player != 0 AND id_player != -1;
[/code]

Ale pojawia się ten błąd:

[code]
ERROR: duplicate key value violates unique constraint "tourney_hand_player_combinations_primary_key"
[/code]

Da się jakoś zmusić bazę, aby wykonała skrypt pomimo błędu? Nie chodzi o znalezienie przyczyny błędu i go wyeliminowanie, ale sprawienie, aby skrypt się wykonał pomimo niego.

Kwestia stabilności takiej bazy i nie jest istotna.

Dzięki!]]></content>
			<author>
				<name><![CDATA[fryzurka]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=1605</uri>
			</author>
			<updated>2013-06-28T14:02:45Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=4623#p4623</id>
		</entry>
</feed>
