I'm working with PHP and Postgres, and if I try to do an EXPLAIN query, with 
PHP, to the postgres backend the output goes to the error_log file of apache 
and I don't know how to redirect that output to the browser.
Does anyone know how I can do this?

Saludos... ;-)

-- 
System Administration: It's a dirty job, 
but someone told I had to do it.
-----------------------------------------------------------------
Martï¿½n Marquï¿½s			email: 	martin@math.unl.edu.ar
Santa Fe - Argentina		http://math.unl.edu.ar/~martin/
Administrador de sistemas en math.unl.edu.ar
-----------------------------------------------------------------

Tue, 9 Jan 2001 16:05:33 -0300
"Martin A. Marques" <martin@math.unl.edu.ar>
How to print explain using PHP

On Tue, 9 Jan 2001, Martin A. Marques wrote:

> I'm working with PHP and Postgres, and if I try to do an EXPLAIN query, with 
> PHP, to the postgres backend the output goes to the error_log file of apache 
> and I don't know how to redirect that output to the browser.


 Good point, before some time somebody (Bruce?) ask if anything is
needful add to PostgreSQL extension in PHP. You found that...

PHP not support libpq's routine:  

PQnoticeProcessor
PQsetNoticeProcessor(	PGconn *conn, 
			PQnoticeProcessor proc, 
			void *arg);



	Karel


Tue, 9 Jan 2001 20:30:43 +0100 (CET)
Karel Zak <zakkr@zf.jcu.cz>
Re: [HACKERS] How to print explain using PHP
El Mar 09 Ene 2001 16:30, Karel Zak escribiï¿½:
> On Tue, 9 Jan 2001, Martin A. Marques wrote:
> > I'm working with PHP and Postgres, and if I try to do an EXPLAIN query,
> > with PHP, to the postgres backend the output goes to the error_log file
> > of apache and I don't know how to redirect that output to the browser.
>
>  Good point, before some time somebody (Bruce?) ask if anything is
> needful add to PostgreSQL extension in PHP. You found that...
>
> PHP not support libpq's routine:
>
> PQnoticeProcessor
> PQsetNoticeProcessor(	PGconn *conn,
> 			PQnoticeProcessor proc,
> 			void *arg);

I think it would be of great help for web programers that use postgres. Any 
way, I'm doing some messy things to get what I want, but it is a very 
needfull extension.

Saludos... :-)

-- 
System Administration: It's a dirty job, 
but someone told I had to do it.
-----------------------------------------------------------------
Martï¿½n Marquï¿½s			email: 	martin@math.unl.edu.ar
Santa Fe - Argentina		http://math.unl.edu.ar/~martin/
Administrador de sistemas en math.unl.edu.ar
-----------------------------------------------------------------

Tue, 9 Jan 2001 16:38:12 -0300
"Martin A. Marques" <martin@math.unl.edu.ar>
Re: How to print explain using PHP
I think the issue here was that these functions don't make any sense for
PHP because you can't register C functions.


> 
> On Tue, 9 Jan 2001, Martin A. Marques wrote:
> 
> > I'm working with PHP and Postgres, and if I try to do an EXPLAIN query, with 
> > PHP, to the postgres backend the output goes to the error_log file of apache 
> > and I don't know how to redirect that output to the browser.
> 
> 
>  Good point, before some time somebody (Bruce?) ask if anything is
> needful add to PostgreSQL extension in PHP. You found that...
> 
> PHP not support libpq's routine:  
> 
> PQnoticeProcessor
> PQsetNoticeProcessor(	PGconn *conn, 
> 			PQnoticeProcessor proc, 
> 			void *arg);
> 
> 
> 
> 	Karel
> 
> 


-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Tue, 9 Jan 2001 14:43:17 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: [HACKERS] How to print explain using PHP

On Tue, 9 Jan 2001, Bruce Momjian wrote:

> I think the issue here was that these functions don't make any sense for
> PHP because you can't register C functions.

I mean (I know) that you can register some common (internal) PHP 
function and this function can call your PHP function. It is some used in 
XML Expat parser that use element handlers (functions). 

It's very good resolvable in PHP... see php-4.0b3/ext/xml/xml.c as example

			Karel

> 
> 
> > 
> > On Tue, 9 Jan 2001, Martin A. Marques wrote:
> > 
> > > I'm working with PHP and Postgres, and if I try to do an EXPLAIN query, with 
> > > PHP, to the postgres backend the output goes to the error_log file of apache 
> > > and I don't know how to redirect that output to the browser.
> > 
> > 
> >  Good point, before some time somebody (Bruce?) ask if anything is
> > needful add to PostgreSQL extension in PHP. You found that...
> > 
> > PHP not support libpq's routine:  
> > 
> > PQnoticeProcessor
> > PQsetNoticeProcessor(	PGconn *conn, 
> > 			PQnoticeProcessor proc, 
> > 			void *arg);
> > 
> > 
> > 
> > 	Karel
> > 
> > 
> 
> 
> -- 
>   Bruce Momjian                        |  http://candle.pha.pa.us
>   pgman@candle.pha.pa.us               |  (610) 853-3000
>   +  If your life is a hard drive,     |  830 Blythe Avenue
>   +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
> 


Tue, 9 Jan 2001 20:52:16 +0100 (CET)
Karel Zak <zakkr@zf.jcu.cz>
Re: [HACKERS] How to print explain using PHP
> 
> On Tue, 9 Jan 2001, Bruce Momjian wrote:
> 
> > I think the issue here was that these functions don't make any sense for
> > PHP because you can't register C functions.
> 
> I mean (I know) that you can register some common (internal) PHP 
> function and this function can call your PHP function. It is some used in 
> XML Expat parser that use element handlers (functions). 
> 
> It's very good resolvable in PHP... see php-4.0b3/ext/xml/xml.c as example

OK, this is why I never added it to the TODO list.  Should we add this
to our TODO list?



-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Tue, 9 Jan 2001 14:53:21 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: [HACKERS] How to print explain using PHP

On Tue, 9 Jan 2001, Bruce Momjian wrote:

> > 
> > On Tue, 9 Jan 2001, Bruce Momjian wrote:
> > 
> > > I think the issue here was that these functions don't make any sense for
> > > PHP because you can't register C functions.
> > 
> > I mean (I know) that you can register some common (internal) PHP 
> > function and this function can call your PHP function. It is some used in 
> > XML Expat parser that use element handlers (functions). 
> > 
> > It's very good resolvable in PHP... see php-4.0b3/ext/xml/xml.c as example
> 
> OK, this is why I never added it to the TODO list.  Should we add this
> to our TODO list?
> 

 Quick look to PHP:-)

libphp/zend_execute_API.c: call_user_function() 


			Karel


Tue, 9 Jan 2001 21:00:41 +0100 (CET)
Karel Zak <zakkr@zf.jcu.cz>
Re: [HACKERS] How to print explain using PHP
> > On Tue, 9 Jan 2001, Bruce Momjian wrote:
> > 
> > > I think the issue here was that these functions don't make any sense for
> > > PHP because you can't register C functions.
> > 
> > I mean (I know) that you can register some common (internal) PHP 
> > function and this function can call your PHP function. It is some used in 
> > XML Expat parser that use element handlers (functions). 
> > 
> > It's very good resolvable in PHP... see php-4.0b3/ext/xml/xml.c as example

IMHO it would be confusing for PHP users. What about changing the PHP
function php_pgsql_do_connect so that it calls PQsetNoticeProcessor to
preserve the last NOTIFY string somewhere. And we would invent new PHP
function pg_notifymessage (or whatever) to extract the string later on.

> OK, this is why I never added it to the TODO list.  Should we add this
> to our TODO list?

I don't think so, if the TODO should only include things to do with
the PostgreSQL source code.
--
Tatsuo Ishii

Wed, 10 Jan 2001 10:58:59 +0900
Tatsuo Ishii <t-ishii@sra.co.jp>
Re: Re: [HACKERS] How to print explain using PHP