Re: SELECT DISTINCT

From: Andrew McMillan <andrew(at)catalyst(dot)net(dot)nz>
To: stev knowles <stev(at)Precision(dot)Guesswork(dot)COM>
Cc: PgSQL Novice ML <pgsql-novice(at)postgresql(dot)org>
Subject: Re: SELECT DISTINCT
Date: 2002-05-23 12:34:45
Message-ID: 1022157285.8178.1517.camel@kant.mcmillan.net.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Thu, 2002-05-23 at 06:01, stev knowles wrote:
>
> the application is not leaving me any pearls of wisdom in the syslog file,
> and the process is not hung up.
>
> i am sure it is something stupid i am doing.
>
> this is the string i am using to query the database:
>
> #define DBGSTRING "SELECT DISTINCT %s FROM %s ;\n"

In this sort of situation I will wrap the query call:

$query = sprintf( DBGSTRING, $fieldname, $tablename );
$result = pg_Exec( $myconn, $query );
error_log( "QF: $query", 0);

Then I can look at syslog after it happened.

Of course you have to enable logging to syslog from within PHP, and if
you do that you might also suddenly discover what is happening through a
more useful error message.

Regards,
Andrew.
--
--------------------------------------------------------------------
Andrew @ Catalyst .Net.NZ Ltd, PO Box 11-053, Manners St, Wellington
WEB: http://catalyst.net.nz/ PHYS: Level 2, 150-154 Willis St
DDI: +64(4)916-7201 MOB: +64(21)635-694 OFFICE: +64(4)499-2267
Are you enrolled at http://schoolreunions.co.nz/ yet?

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Joshua b. Jore 2002-05-23 12:35:48 Re: when to use char, varchar or text
Previous Message Andrew McMillan 2002-05-23 12:28:44 Re: optimising data load