Re: migration problem - Mailing list pgsql-general

From Craig Ringer
Subject Re: migration problem
Date
Msg-id 482EA3D1.4070308@postnewspapers.com.au
Whole thread Raw
In response to migration problem  (PJ <af.gourmet@videotron.ca>)
Responses Re: migration problem  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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

pgsql-general by date:

Previous
From: Craig Ringer
Date:
Subject: Re: writing a function without installing a language
Next
From: Craig Ringer
Date:
Subject: Re: how to return parts of records from a function