Received: from sss.pgh.pa.us (sss.pgh.pa.us [209.114.132.154]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f05GhB712798 for ; Fri, 5 Jan 2001 11:43:11 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.1/8.11.1) with ESMTP id f05GhOB10248; Fri, 5 Jan 2001 11:43:24 -0500 (EST) To: Jeff Davis cc: pgsql-general@postgresql.org Subject: Re: Explain In-reply-to: <0101050121130A.01054@jdavis> References: <0101050121130A.01054@jdavis> Comments: In-reply-to Jeff Davis message dated "Fri, 05 Jan 2001 01:18:34 -0800" Date: Fri, 05 Jan 2001 11:43:24 -0500 Message-ID: <10245.978713004@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200101/183 X-Sequence-Number: 2349 Jeff Davis writes: > How can I conveniently handle output from an EXPLAIN query inside an > application? It appears to just immediately send the output to the stdout of > whatever program uses it. Is there a way to get the output inside a program, > with libpq or otherwise? The EXPLAIN result is sent as a NOTICE message, so you can trap it by setting libpq's notice processor function --- see PQsetNoticeProcessor. regards, tom lane