Re: migration problem

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: PJ <af(dot)gourmet(at)videotron(dot)ca>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: migration problem
Date: 2008-05-17 09:22:25
Message-ID: 482EA3D1.4070308@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

PJ wrote:

> ($_SERVER["DOCUMENT_ROOT"]...... and all that is well. However, there seems to
> be a problem with the sql code which was done by another party. There is a
> function "checkuser" which is invoked upon login from index.php. The instruction
> is: checkuser(array(0,1,2,3,4,5,6));...... and there it stops.

That function hits the database repeatedly. If the problem is in fact
with a database query that it's generating you need to determine which
one. You could step through the function with a PHP debugger or just
insert log/printing statements in the function so you can see its progress.

Alternately, run the problem checkuser() function then in psql run:

select * from pg_stat_activity;

and see if there are any long-running queries in there that correspond
to SQL generated by the checkuser() call.

Once you know which part of the function is causing a problem, you can
perhaps discover something useful. If you track it down to a particular
query that the function is generating, and you can't figure out what's
wrong by looking at the query, you can try running it with EXPLAIN in psql.

--
Craig Ringer

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Leif B. Kristensen 2008-05-17 09:23:09 Re: writing a function without installing a language
Previous Message Craig Ringer 2008-05-17 09:14:17 Re: writing a function without installing a language