<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Forum PostgreSQL - problem z triggerem]]></title>
	<link rel="self" href="http://forum.postgresql.org.pl/extern.php?action=feed&amp;tid=309&amp;type=atom"/>
	<updated>2009-10-06T10:52:07Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.postgresql.org.pl/viewtopic.php?id=309</id>
		<entry>
			<title type="html"><![CDATA[Odp: problem z triggerem]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=1365#p1365"/>
			<content type="html"><![CDATA[To jest akurat szkic funkcji. Pokaz definicje triggera.]]></content>
			<author>
				<name><![CDATA[rski]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=26</uri>
			</author>
			<updated>2009-10-06T10:52:07Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=1365#p1365</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[problem z triggerem]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=1364#p1364"/>
			<content type="html"><![CDATA[Witam

Chciałbym stworzyć trigger który będzie eksportował dane do pliku. Jednak z niewiadomych powodów dostaję błedem po twarzy.

oto szkic trigera:
[quote]
CREATE OR REPLACE FUNCTION pro_trg()
  RETURNS "trigger" AS 
$BODY$
DECLARE
mq integer;
BEGIN

COPY (select * from table where id = new.id) 		
		TO 'C:\\data1.csv'
		WITH DELIMITER AS '|'
		NULL AS 'null';

RETURN NULL;
END;
$BODY$
  LANGUAGE 'plpgsql' VOLATILE;
[/quote]

Błąd jaki dostaję to "no value foud for parameter 1"
Tak jakby copy nie widziało danej new.id...

Czy miał ktoś już taki przypadek ??]]></content>
			<author>
				<name><![CDATA[piotry]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=984</uri>
			</author>
			<updated>2009-10-06T10:43:08Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=1364#p1364</id>
		</entry>
</feed>
