X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 29DE053481 for ; Fri, 22 Apr 2005 16:18:13 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 36855-05 for ; Fri, 22 Apr 2005 19:18:03 +0000 (GMT) Received: from poczta.o2.pl (mx2.go2.pl [193.17.41.42]) by svr1.postgresql.org (Postfix) with ESMTP id 0F99E534CF for ; Fri, 22 Apr 2005 16:18:00 -0300 (ADT) Received: from localhost (plus.ds14.agh.edu.pl [149.156.124.14]) by poczta.o2.pl (Postfix) with ESMTP id DCA6E340011 for ; Fri, 22 Apr 2005 21:18:00 +0200 (CEST) Date: Fri, 22 Apr 2005 21:18:00 +0200 From: Jakub =?ISO-8859-2?Q?Wo=BCny?= To: pgsql-sql@postgresql.org Subject: C function - other process Message-ID: <20050422211800.241cf201@localhost> X-Mailer: Sylpheed-Claws 1.0.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=2.585 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, FORGED_RCVD_HELO X-Spam-Level: ** X-Archive-Number: 200504/329 X-Sequence-Number: 21222 Hello, I wrote a simple function: PG_FUNCTION_INFO_V1(my_fcn); Datum my_fcn() { int i,ret; i=0; signal(SIGCHLD,SIG_IGN); switch(fork()) { case 0: { SPI_connect(); for(i=0;i<10;i++) { SPI_exec("insert into my_tmp values ('asdasd');",1); sleep(1); } ret = SPI_finish(); exit(ret); } default: { ; } } } Next I create a function in my database: CREATE FUNCTION my_fcn() RETURNS void AS '$libdir/my_fcn', 'my_fcn' LANGUAGE c; Now I execute "select my_fcn();" and I don't see records in table 'my_tmp', but function works. I checked returns values from SPI function, tehere are correct. What is wrong? Best regards, jakub -- kubaw@o2.pl