pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: babak badaei <badaei@yahoo.com>
To: pgsql-php@postgresql.org
Subject: Fw: Postgres 8.1.4 + PHP, hangs when querying more than 16 records!
Date: Thu, 31 Aug 2006 02:51:34 -0700 (PDT)
Message-ID: <20060831095134.80186.qmail@web55206.mail.re4.yahoo.com> (raw)

In addition to below; I compile postgres 7.4.12. Same thing!!! More than 16 records hangs!

----- Forwarded Message ----
From: babak badaei <badaei@yahoo.com>
To: pgsql-php@postgresql.org
Sent: Wednesday, August 30, 2006 11:25:58 PM
Subject: Postgres 8.1.4 + PHP, hangs when querying more than 16 records!

OS: Fedora Core 5
PHP: PHP 5.1.4, PHP 5.1.6, and  PHP 4.4.4 (compiled with --with-pgsql and install as binaries using YUM)
Postgres 8.1.4

This scripts works:
---------------------------------------------------------------------------------
<?php
// Connecting, selecting database
$dbconn = pg_connect("host=localhost dbname=database user=web")
   or die('Could not connect: ' . pg_last_error());

// Performing SQL query
$query = 'SELECT * FROM foobar limit 16';

$result = pg_query($query) or die('Query failed: ' . pg_last_error());


// Printing results in HTML
echo "<table>\n";
while ($line = pg_fetch_array($result, null, PGSQL_ASSOC)) {
   echo "\t<tr>\n";
   foreach ($line as $col_value) {
       echo "\t\t<td>$col_value</td>\n";
   }
   echo "\t</tr>\n";
}
echo "</table>\n";

// Free resultset
pg_free_result($result);

// Closing connection
pg_close($dbconn);
?> 
---------------------------------------------------------------------------------
This script hangs:

-----------------------------------------------------------------------------------
 <?php
 // Connecting, selecting database
 $dbconn = pg_connect("host=localhost dbname=database user=web")
    or die('Could not connect: ' . pg_last_error());
 
 // Performing SQL query
 $query = 'SELECT * FROM foobar limit 17';
 
 $result = pg_query($query) or die('Query failed: ' . pg_last_error());
 
 
 // Printing results in HTML
 echo "<table>\n";
 while ($line = pg_fetch_array($result, null, PGSQL_ASSOC)) {
    echo "\t<tr>\n";
    foreach ($line as $col_value) {
        echo "\t\t<td>$col_value</td>\n";
    }
    echo "\t</tr>\n";
 }
 echo "</table>\n";
 
 // Free resultset
 pg_free_result($result);
 
 // Closing connection
 pg_close($dbconn);
 ?> 
-------------------------------------------------------------------------------------



The only difference is that in the first we limit to 16 records, in the latter, to 17 (and greater hangs as well). I tried with three different versions of PHP, as mentioned above (PHP 5.1.4, 5.1.6, & 4.4.4) from both Apache and from the command line. Attempted few times each when compiled versions and binary distributions via yum. All behave the same way. All hang above 17 records.

Take care! Babak.












view thread (9+ messages)  latest in thread

Message-ID: <20060831095134.80186.qmail@web55206.mail.re4.yahoo.com>
Permalink:  ../20060831095134.80186.qmail@web55206.mail.re4.yahoo.com/
Also on:    postgresql.org/message-id/20060831095134.80186.qmail@web55206.mail.re4.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: badaei@yahoo.com
  Subject: Re: Fw: Postgres 8.1.4 + PHP, hangs when querying more than 16 records!
  In-Reply-To: <20060831095134.80186.qmail@web55206.mail.re4.yahoo.com>
  References: <20060831095134.80186.qmail@web55206.mail.re4.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox