Log SQL code before executing it

Started by Alexander Farberabout 17 years ago3 messagesgeneral
Jump to latest
#1Alexander Farber
alexander.farber@gmail.com

Dear PgSQL users,

is there please a way to display the executed SQL code?

I'm using phpBB 3.0.4 / PostgreSQL 8.2.6 / PHP 5.2.5 / OpenBSD 4.3
to develop a card game in Flash / C / Perl (at http://preferans.de )
and would like to log each game round by simply posting and replying
in one of the phpBB forums. The phpBB's code however is very hairy
and I have troubles to follow it and to reconstruct the SQL statements
needed for posting and replying.

Thank you for any hints
Alex

PS: Or maybe it's possible to overload $db->sql_query($sql) in PHP?

In reply to: Alexander Farber (#1)
Re: Log SQL code before executing it

On Fri, Mar 06, 2009 at 11:24:16PM +0100, Alexander Farber wrote:

is there please a way to display the executed SQL code?

log_statement in postgresql.conf

depesz

--
Linkedin: http://www.linkedin.com/in/depesz / blog: http://www.depesz.com/
jid/gtalk: depesz@depesz.com / aim:depeszhdl / skype:depesz_hdl / gg:6749007

#3Chris
dmagick@gmail.com
In reply to: Alexander Farber (#1)
Re: Log SQL code before executing it

Alexander Farber wrote:

Dear PgSQL users,

is there please a way to display the executed SQL code?

I'm using phpBB 3.0.4 / PostgreSQL 8.2.6 / PHP 5.2.5 / OpenBSD 4.3
to develop a card game in Flash / C / Perl (at http://preferans.de )
and would like to log each game round by simply posting and replying
in one of the phpBB forums. The phpBB's code however is very hairy
and I have troubles to follow it and to reconstruct the SQL statements
needed for posting and replying.

If they have one, use their API to do it. If they change things between
versions (even minor versions), you'll have to start from scratch to
find why your stuff doesn't work any more.

PS: Or maybe it's possible to overload $db->sql_query($sql) in PHP?

see if it's defined in their code.

grep -nri 'function sql_query' /path/to/folder

--
Postgresql & php tutorials
http://www.designmagick.com/