X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id D4CA9474E5C for ; Thu, 13 Feb 2003 02:24:44 -0500 (EST) Received: from news.hub.org (news.hub.org [64.49.215.80]) by postgresql.org (Postfix) with ESMTP id 6663A474E44 for ; Thu, 13 Feb 2003 02:24:44 -0500 (EST) Received: by news.hub.org (Postfix, from userid 8) id 5093F43A666; Thu, 13 Feb 2003 02:24:44 -0500 (EST) From: "Frankie Lam" X-Newsgroups: comp.databases.postgresql.sql Subject: Re: dblink question please Date: Thu, 13 Feb 2003 15:25:44 +0800 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 60 Message-ID: References: X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 To: pgsql-sql@postgresql.org X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/277 X-Sequence-Number: 11675 Thanks, Joe. Now I use only persistent connection inside my PLPGSQL functions, the EXCEPTION "ExecMakerTableFunctionResult: Invalid result from function returning tuple" has gone. The only problem left behind is it takes dblink function (such as dblink_exec('update foo set f1=true')) very long time to return(abuot 16 mins), in case if I do "extreme" test on it(like unplugging the network cable while dblink_exec() function is still working on remote host). It seems to me this is a matter of libPQ (because connect_timeout doesn't work in the case), but someone told me this is nothing to do with libPQ, and it's possible a matter of KERNEL and transport layer of tcp protocol.(I don't really understand these stuff) Is this true?(If this is true, then I have to abort my project :-( ) Regards Frankie. "Joe Conway" wrote in message news:3E4B2BA5.3020409@joeconway.com... > Frankie Lam wrote: > > Yah! > > > > That's exactly what I did already(did this to all lines containing > > `elog(ERROR...)'. :-D > > But, I'm still experiencing some error messages when I'm doing 'extreme' > > test to > > plpgsql functions, > > for example 'ExecMakerTableFunctionResult: Invalid result from function > > returning tuple'. > > > > I really have no idea about what this message is related to the dblink > > functions. Any idea > > about it? Thanks so much. > > Sounds like you didn't heed my warning. It is *probably* safe to make > the elog(ERROR...) to elog(NOTICE...) change *in that one function*, > dblink_connect(), and then use persistent connections, e.g. > > select dblink_connect('dbname=blah ...'); > select * from dblink('select f1 from foo') as (f1 text); > > If instead you made the change within the dblink_record() function, and > you weren't careful to add additional error handling, then the message > you got is what I'd expect. You basically broke dblink for those scenarios. > > Joe > > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org