<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Forum PostgreSQL - nieobsługiwany UPDATE przez SELECT]]></title>
	<link rel="self" href="http://forum.postgresql.org.pl/extern.php?action=feed&amp;tid=48&amp;type=atom"/>
	<updated>2008-06-09T10:55:32Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.postgresql.org.pl/viewtopic.php?id=48</id>
		<entry>
			<title type="html"><![CDATA[Odp: nieobsługiwany UPDATE przez SELECT]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=173#p173"/>
			<content type="html"><![CDATA[dzięki ;-)]]></content>
			<author>
				<name><![CDATA[agniecha]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=121</uri>
			</author>
			<updated>2008-06-09T10:55:32Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=173#p173</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Odp: nieobsługiwany UPDATE przez SELECT]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=172#p172"/>
			<content type="html"><![CDATA[Nie wiem czy o to chodzi ale zalozmy ze mamy dwie tabele t1(i, c1,c2) i t2(i,c1,c2)
[code]>select * from  t1;
 i | c1 | c2
---+----+----
 1 | a  | A
 2 | b  | B
 3 | c  | C
(3 rows)

>select * from t2;
 i |  c1  |  c2
---+------+------
 1 | null | null
 2 | null | null
 4 | null | null
(3 rows)[/code]
To po wykonaniu nastepujacego update
[code]>update t2 set c1=t1.c1,c2=t1.c2 from t1 where t1.i=t2.i;
Time: 11,393 ms
(rski@[local]:5432) 12:50:33 [rski][/code]
mamy
[code]>select * from t2;
 i |  c1  |  c2
---+------+------
 4 | null | null
 1 | a    | A
 2 | b    | B
(3 rows)[/code]
o to chodzilo, update moze miec klauzule FROM.]]></content>
			<author>
				<name><![CDATA[rski]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=26</uri>
			</author>
			<updated>2008-06-09T10:51:48Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=172#p172</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[nieobsługiwany UPDATE przez SELECT]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=170#p170"/>
			<content type="html"><![CDATA[Witajcie,
mam pytanie, właśnie doczytałam, że coś takiego:
UPDATE tabv SET (v1,v2,v3) = (SELECT z1,z2,z3 FROM tabz WHERE tabv.v1 = tabz.z1);
nie jest zaimplementowane w PostgrSQL.
Czy jest jakies obejście, czy pozostaje mi zdefiniowac kursory i nimi sie posługiwać?

z góry dzięki za szybką odpowiedź
a.]]></content>
			<author>
				<name><![CDATA[agniecha]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=121</uri>
			</author>
			<updated>2008-06-09T09:37:51Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=170#p170</id>
		</entry>
</feed>
