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.





---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq
babak badaei [ Do, 31 August 2006 08:25 ] [ ID #1451221 ]

Re: Postgres 8.1.4 + PHP, hangs when querying more than 16

babak badaei wrote:
> 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';

<snip>

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

That seems really weird.

If you run those through psql natively what happens?

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

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster
Chris [ Do, 31 August 2006 08:42 ] [ ID #1451222 ]

Re: Postgres 8.1.4 + PHP, hangs when querying more than 16 records!

Hi Chris, Run through the native client everything works fine. I know, its really strange. Any ideas?

----- Original Message ----
From: Chris <dmagick [at] gmail.com>
To: babak badaei <badaei [at] yahoo.com>
Cc: pgsql-php [at] postgresql.org
Sent: Wednesday, August 30, 2006 11:42:01 PM
Subject: Re: [PHP] Postgres 8.1.4 + PHP, hangs when querying more than 16 records!

babak badaei wrote:
> 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';

<snip>

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

That seems really weird.

If you run those through psql natively what happens?

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




---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend
babak badaei [ Do, 31 August 2006 09:42 ] [ ID #1451223 ]

Re: Postgres 8.1.4 + PHP, hangs when querying more than 16 records!

Have you tried with pdo?

$pdo = new PDO('pgsql:host=localhost;dbname=database','web');
$query = $pdo->query('SELECT * FROM foobar;');
$query->execute();
$data = $query->fetchAll(PDO::FETCH_OBJ);
print_r($data);

And have you tried not using other peoples packages but downloading
the source and compiling it? I run PHP 5.1.4 and work with very
large data sets, though I've not upgraded to 5.1.6 yet.

Hope this helps,

Gavin


On Aug 31, 2006, at 12:42 AM, babak badaei wrote:

> Hi Chris, Run through the native client everything works fine. I
> know, its really strange. Any ideas?
>
> ----- Original Message ----
> From: Chris <dmagick [at] gmail.com>
> To: babak badaei <badaei [at] yahoo.com>
> Cc: pgsql-php [at] postgresql.org
> Sent: Wednesday, August 30, 2006 11:42:01 PM
> Subject: Re: [PHP] Postgres 8.1.4 + PHP, hangs when querying more
> than 16 records!
>
> babak badaei wrote:
>> 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';
>
> <snip>
>
>> // Performing SQL query
>> $query = 'SELECT * FROM foobar limit 17';
>
> That seems really weird.
>
> If you run those through psql natively what happens?
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>
>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 6: explain analyze is your friend


---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match
gmr [ Do, 31 August 2006 17:55 ] [ ID #1451225 ]

Re: Postgres 8.1.4 + PHP, hangs when querying more than 16 records!

Hi Gavid, Thanks, no I have not tried PDO but I have compiled 3 different versions of PHP from source with similar results as the 3 different versions from binary distribution. Same for Postgres (compiled from source and dropped-in binary stuff) for two different versions.

Thanks again! Babak.

----- Original Message ----
From: Gavin M. Roy <gmr [at] ehpg.net>
To: babak badaei <badaei [at] yahoo.com>
Cc: pgsql-php [at] postgresql.org
Sent: Thursday, August 31, 2006 8:55:01 AM
Subject: Re: [PHP] Postgres 8.1.4 + PHP, hangs when querying more than 16 records!

Have you tried with pdo?

$pdo = new PDO('pgsql:host=localhost;dbname=database','web');
$query = $pdo->query('SELECT * FROM foobar;');
$query->execute();
$data = $query->fetchAll(PDO::FETCH_OBJ);
print_r($data);

And have you tried not using other peoples packages but downloading
the source and compiling it? I run PHP 5.1.4 and work with very
large data sets, though I've not upgraded to 5.1.6 yet.

Hope this helps,

Gavin


On Aug 31, 2006, at 12:42 AM, babak badaei wrote:

> Hi Chris, Run through the native client everything works fine. I
> know, its really strange. Any ideas?
>
> ----- Original Message ----
> From: Chris <dmagick [at] gmail.com>
> To: babak badaei <badaei [at] yahoo.com>
> Cc: pgsql-php [at] postgresql.org
> Sent: Wednesday, August 30, 2006 11:42:01 PM
> Subject: Re: [PHP] Postgres 8.1.4 + PHP, hangs when querying more
> than 16 records!
>
> babak badaei wrote:
>> 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';
>
> <snip>
>
>> // Performing SQL query
>> $query = 'SELECT * FROM foobar limit 17';
>
> That seems really weird.
>
> If you run those through psql natively what happens?
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>
>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 6: explain analyze is your friend


---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match






---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo [at] postgresql.org so that your
message can get through to the mailing list cleanly
babak badaei [ Do, 31 August 2006 18:15 ] [ ID #1451226 ]

Re: Postgres 8.1.4 + PHP, hangs when querying more than 16 records!

--0-198202980-1157041749=:97134
Content-Type: text/plain; charset=us-ascii

Hello again; I just finished trying the method below with the same results. 16 records work, more than that it hangs!! Thanks for your help. Babak.

----- Original Message ----
From: Gavin M. Roy <gmr [at] ehpg.net>
To: babak badaei <badaei [at] yahoo.com>
Cc: pgsql-php [at] postgresql.org
Sent: Thursday, August 31, 2006 8:55:01 AM
Subject: Re: [PHP] Postgres 8.1.4 + PHP, hangs when querying more than 16 records!

Have you tried with pdo?

$pdo = new PDO('pgsql:host=localhost;dbname=database','web');
$query = $pdo->query('SELECT * FROM foobar;');
$query->execute();
$data = $query->fetchAll(PDO::FETCH_OBJ);
print_r($data);

And have you tried not using other peoples packages but downloading
the source and compiling it? I run PHP 5.1.4 and work with very
large data sets, though I've not upgraded to 5.1.6 yet.

Hope this helps,

Gavin


On Aug 31, 2006, at 12:42 AM, babak badaei wrote:

> Hi Chris, Run through the native client everything works fine. I
> know, its really strange. Any ideas?
>
> ----- Original Message ----
> From: Chris <dmagick [at] gmail.com>
> To: babak badaei <badaei [at] yahoo.com>
> Cc: pgsql-php [at] postgresql.org
> Sent: Wednesday, August 30, 2006 11:42:01 PM
> Subject: Re: [PHP] Postgres 8.1.4 + PHP, hangs when querying more
> than 16 records!
>
> babak badaei wrote:
>> 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';
>
> <snip>
>
>> // Performing SQL query
>> $query = 'SELECT * FROM foobar limit 17';
>
> That seems really weird.
>
> If you run those through psql natively what happens?
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>
>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 6: explain analyze is your friend


---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match





--0-198202980-1157041749=:97134
Content-Type: text/html; charset=us-ascii

<html><head><style type="text/css"><!-- DIV {margin:0px} --></style></head><body><div style="font-family:arial, helvetica, sans-serif;font-size:12pt"><div style="font-family: arial,helvetica,sans-serif; font-size: 12pt;">Hello again; I just finished trying the method below with the same results. 16 records work, more than that it hangs!! Thanks for your help. Babak.<br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: Gavin M. Roy <gmr [at] ehpg.net><br>To: babak badaei <badaei [at] yahoo.com><br>Cc: pgsql-php [at] postgresql.org<br>Sent: Thursday, August 31, 2006 8:55:01 AM<br>Subject: Re: [PHP] Postgres 8.1.4 + PHP, hangs when querying more than 16 records!<br><br><div>Have you tried with pdo?<br><br>$pdo = new PDO('pgsql:host=localhost;dbname=database','web');<br>$query = $pdo->query('SELECT * FROM foobar;');<br>$
query->execute();<br>$data =
$query->fetchAll(PDO::FETCH_OBJ);<br>print_r($data);<br><br>And have you tried not using other peoples packages but downloading  <br>the source and compiling it?  I run PHP 5.1.4 and work with very  <br>large data sets, though I've not upgraded to 5.1.6 yet.<br><br>Hope this helps,<br><br>Gavin<br><br><br>On Aug 31, 2006, at 12:42 AM, babak badaei wrote:<br><br>> Hi Chris, Run through the native client everything works fine. I  <br>> know, its really strange. Any ideas?<br>><br>> ----- Original Message ----<br>> From: Chris <dmagick [at] gmail.com><br>> To: babak badaei <badaei [at] yahoo.com><br>> Cc: pgsql-php [at] postgresql.org<br>> Sent: Wednesday, August 30, 2006 11:42:01 PM<br>> Subject: Re: [PHP] Postgres 8.1.4 + PHP, hangs when querying more  <br>> than 16 records!<br>><br>> babak badaei wrote
:<br>>> OS: Fedora Core 5<br>>> PHP: PHP 5.1.4, PHP 5.1.6,
and  PHP 4.4.4 (compiled with --with- <br>>> pgsql and install as binaries using YUM)<br>>> Postgres 8.1.4<br>>><br>>> This scripts works:<br>>> ------------------------------------------------------------ --------- <br>>> ------------<br>>> <?php<br>>> // Connecting, selecting database<br>>> $dbconn = pg_connect("host=localhost dbname=database user=web")<br>>>    or die('Could not connect: ' . pg_last_error());<br>>><br>>> // Performing SQL query<br>>> $query = 'SELECT * FROM foobar limit 16';<br>><br>> <snip><br>><br>>>  // Performing SQL query<br>>>  $query = 'SELECT * FROM foobar limit 17';<br>><br>> That seems really weird.<br>><br>> If you run those through psql natively what happens?<br>><br>> -- <br>> Po
stgresql & php tutorials<br>> <a target="_blank"
href="http://www.designmagick.com/">http://www.designmagick. com/</a><br>><br>><br>><br>><br>> ---------------------------(end of  <br>> broadcast)---------------------------<br>> TIP 6: explain analyze is your friend<br><br><br>---------------------------(end of broadcast)---------------------------<br>TIP 9: In versions below 8.0, the planner will ignore your desire to<br>       choose an index scan if your joining column's datatypes do not<br>       match<br></div></div><br></div></div></body></html>
--0-198202980-1157041749=:97134--
babak badaei [ Do, 31 August 2006 18:29 ] [ ID #1451227 ]

Re: Postgres 8.1.4 + PHP, hangs when querying more than 16 records!

--Apple-Mail-3-504461470
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
delsp=yes;
format=flowed

Wow I'd say that something is terribly wrong with your machine, or
it's install of pgsql, other than running fedora ;-). Out of
curiosity what's the row size? how many fields and what's the schema
look like?




On Aug 31, 2006, at 9:29 AM, babak badaei wrote:

> Hello again; I just finished trying the method below with the same
> results. 16 records work, more than that it hangs!! Thanks for your
> help. Babak.
>
> ----- Original Message ----
> From: Gavin M. Roy <gmr [at] ehpg.net>
> To: babak badaei <badaei [at] yahoo.com>
> Cc: pgsql-php [at] postgresql.org
> Sent: Thursday, August 31, 2006 8:55:01 AM
> Subject: Re: [PHP] Postgres 8.1.4 + PHP, hangs when querying more
> than 16 records!
>
> Have you tried with pdo?
>
> $pdo = new PDO('pgsql:host=localhost;dbname=database','web');
> $query = $pdo->query('SELECT * FROM foobar;');
> $query->execute();
> $data = $query->fetchAll(PDO::FETCH_OBJ);
> print_r($data);
>
> And have you tried not using other peoples packages but downloading
> the source and compiling it? I run PHP 5.1.4 and work with very
> large data sets, though I've not upgraded to 5.1.6 yet.
>
> Hope this helps,
>
> Gavin
>
>
> On Aug 31, 2006, at 12:42 AM, babak badaei wrote:
>
> > Hi Chris, Run through the native client everything works fine. I
> > know, its really strange. Any ideas?
> >
> > ----- Original Message ----
> > From: Chris <dmagick [at] gmail.com>
> > To: babak badaei <badaei [at] yahoo.com>
> > Cc: pgsql-php [at] postgresql.org
> > Sent: Wednesday, August 30, 2006 11:42:01 PM
> > Subject: Re: [PHP] Postgres 8.1.4 + PHP, hangs when querying more
> > than 16 records!
> >
> > babak badaei wrote:
> >> 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';
> >
> > <snip>
> >
> >> // Performing SQL query
> >> $query = 'SELECT * FROM foobar limit 17';
> >
> > That seems really weird.
> >
> > If you run those through psql natively what happens?
> >
> > --
> > Postgresql & php tutorials
> > http://www.designmagick.com/
> >
> >
> >
> >
> > ---------------------------(end of
> > broadcast)---------------------------
> > TIP 6: explain analyze is your friend
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match
>
>


--Apple-Mail-3-504461470
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
charset=ISO-8859-1

<HTML><BODY style=3D"word-wrap: break-word; -khtml-nbsp-mode: space; =
-khtml-line-break: after-white-space; ">Wow I'd say that something is =
terribly wrong with your machine, or it's install of pgsql, other than =
running fedora ;-).=A0 Out of curiosity what's the row size?=A0 how many =
fields and what's the schema look like?<DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV><BR><DIV><DIV>On Aug 31, =
2006, at 9:29 AM, babak badaei wrote:</DIV><BR =
class=3D"Apple-interchange-newline"><BLOCKQUOTE type=3D"cite"><SPAN =
class=3D"Apple-style-span" style=3D"border-collapse: separate; =
border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant: normal; font-weight: =
normal; letter-spacing: normal; line-height: normal; text-align: auto; =
-khtml-text-decorations-in-effect: none; text-indent: 0px; =
-apple-text-size-adjust: auto; text-transform: none; orphans: 2; =
white-space: normal; widows: 2; word-spacing: 0px; "><DIV =
style=3D"font-family:arial, helvetica, sans-serif;font-size:12pt; =
font-family: arial; font-size: 16px; "><DIV style=3D"font-family: =
arial,helvetica,sans-serif; font-size: 12pt;; font-family: arial; =
font-size: 16px; "><SPAN class=3D"Apple-style-span" style=3D"font-family: =
arial; font-size: 16px; ">Hello again; I just finished trying the method =
below with the same results. 16 records work, more than that it hangs!! =
Thanks for your help. Babak.</SPAN><BR style=3D"font-family: arial; =
font-size: 16px; "><BR style=3D"font-family: arial; font-size: 16px; =
"><DIV style=3D"font-family: times new roman,new york,times,serif; =
font-size: 12pt;; font-family: times new roman; font-size: 16px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">----- Original Message ----</SPAN><BR =
style=3D"font-family: times new roman; font-size: 16px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">From: Gavin M. Roy <<A =
href=3D"mailto:gmr [at] ehpg.net">gmr [at] ehpg.net</A>></SPAN><BR =
style=3D"font-family: times new roman; font-size: 16px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">To: babak badaei <<A =
href=3D"mailto:badaei [at] yahoo.com">badaei [at] yahoo.com</A>></SPAN><BR =
style=3D"font-family: times new roman; font-size: 16px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">Cc: <A =
href=3D"mailto:pgsql-php [at] postgresql.org">pgsql-php [at] postgresq l.org</A></SPA=
N><BR style=3D"font-family: times new roman; font-size: 16px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">Sent: Thursday, August 31, 2006 8:55:01 AM</SPAN><BR =
style=3D"font-family: times new roman; font-size: 16px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">Subject: Re: [PHP] Postgres 8.1.4 + PHP, hangs when =
querying more than 16 records!</SPAN><BR style=3D"font-family: times new =
roman; font-size: 16px; "><BR style=3D"font-family: times new roman; =
font-size: 16px; "><DIV style=3D"font-family: times new roman; =
font-size: 16px; "><SPAN class=3D"Apple-style-span" style=3D"font-family: =
times new roman; font-size: 16px; ">Have you tried with pdo?</SPAN><BR =
style=3D"font-family: times new roman; font-size: 16px; "><BR =
style=3D"font-family: times new roman; font-size: 16px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">$pdo =3D new =
PDO('pgsql:host=3Dlocalhost;dbname=3Ddatabase','web');</SPAN><BR =
style=3D"font-family: times new roman; font-size: 16px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">$query =3D $pdo->query('SELECT * FROM =
foobar;');</SPAN><BR style=3D"font-family: times new roman; font-size: =
16px; "><SPAN class=3D"Apple-style-span" style=3D"font-family: times new =
roman; font-size: 16px; ">$query->execute();</SPAN><BR =
style=3D"font-family: times new roman; font-size: 16px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">$data =3D =
$query->fetchAll(PDO::FETCH_OBJ);</SPAN><BR style=3D"font-family: =
times new roman; font-size: 16px; "><SPAN class=3D"Apple-style-span" =
style=3D"font-family: times new roman; font-size: 16px; =
">print_r($data);</SPAN><BR style=3D"font-family: times new roman; =
font-size: 16px; "><BR style=3D"font-family: times new roman; font-size: =
16px; "><SPAN class=3D"Apple-style-span" style=3D"font-family: times new =
roman; font-size: 16px; ">And have you tried not using other peoples =
packages but downloading=A0=A0</SPAN><BR style=3D"font-family: times new =
roman; font-size: 16px; "><SPAN class=3D"Apple-style-span" =
style=3D"font-family: times new roman; font-size: 16px; ">the source and =
compiling it?=A0=A0I run PHP 5.1.4 and work with very=A0=A0</SPAN><BR =
style=3D"font-family: times new roman; font-size: 16px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">large data sets, though I've not upgraded to 5.1.6 =
yet.</SPAN><BR style=3D"font-family: times new roman; font-size: 16px; =
"><BR style=3D"font-family: times new roman; font-size: 16px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">Hope this helps,</SPAN><BR style=3D"font-family: =
times new roman; font-size: 16px; "><BR style=3D"font-family: times new =
roman; font-size: 16px; "><SPAN class=3D"Apple-style-span" =
style=3D"font-family: times new roman; font-size: 16px; =
">Gavin</SPAN><BR style=3D"font-family: times new roman; font-size: =
16px; "><BR style=3D"font-family: times new roman; font-size: 16px; =
"><BR style=3D"font-family: times new roman; font-size: 16px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">On Aug 31, 2006, at 12:42 AM, babak badaei =
wrote:</SPAN><BR style=3D"font-family: times new roman; font-size: 16px; =
"><BR style=3D"font-family: times new roman; font-size: 16px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">> Hi Chris, Run through the native client =
everything works fine. I=A0=A0</SPAN><BR style=3D"font-family: times new =
roman; font-size: 16px; "><SPAN class=3D"Apple-style-span" =
style=3D"font-family: times new roman; font-size: 16px; ">> know, its =
really strange. Any ideas?</SPAN><BR style=3D"font-family: times new =
roman; font-size: 16px; "><SPAN class=3D"Apple-style-span" =
style=3D"font-family: times new roman; font-size: 16px; ">></SPAN><BR =
style=3D"font-family: times new roman; font-size: 16px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">> ----- Original Message ----</SPAN><BR =
style=3D"font-family: times new roman; font-size: 16px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">> From: Chris <<A =
href=3D"mailto:dmagick [at] gmail.com">dmagick [at] gmail.com</A>></SPAN><BR =
style=3D"font-family: times new roman; font-size: 16px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">> To: babak badaei <<A =
href=3D"mailto:badaei [at] yahoo.com">badaei [at] yahoo.com</A>></SPAN><BR =
style=3D"font-family: times new roman; font-size: 16px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">> Cc: <A =
href=3D"mailto:pgsql-php [at] postgresql.org">pgsql-php [at] postgresq l.org</A></SPA=
N><BR style=3D"font-family: times new roman; font-size: 16px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">> Sent: Wednesday, August 30, 2006 11:42:01 =
PM</SPAN><BR style=3D"font-family: times new roman; font-size: 16px; =
"><SPAN class=3D"Apple-style-span" style=3D"font-family: times new =
roman; font-size: 16px; ">> Subject: Re: [PHP] Postgres 8.1.4 + PHP, =
hangs when querying more=A0=A0</SPAN><BR style=3D"font-family: times new =
roman; font-size: 16px; "><SPAN class=3D"Apple-style-span" =
style=3D"font-family: times new roman; font-size: 16px; ">> than 16 =
records!</SPAN><BR style=3D"font-family: times new roman; font-size: =
16px; "><SPAN class=3D"Apple-style-span" style=3D"font-family: times new =
roman; font-size: 16px; ">></SPAN><BR style=3D"font-family: times new =
roman; font-size: 16px; "><SPAN class=3D"Apple-style-span" =
style=3D"font-family: times new roman; font-size: 16px; ">> babak =
badaei wrote:</SPAN><BR style=3D"font-family: times new roman; =
font-size: 16px; "><SPAN class=3D"Apple-style-span" style=3D"font-family: =
times new roman; font-size: 16px; ">>> OS: Fedora Core 5</SPAN><BR =
style=3D"font-family: times new roman; font-size: 16px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">>> PHP: PHP 5.1.4, PHP 5.1.6, and=A0=A0PHP =
4.4.4 (compiled with --with- </SPAN><BR style=3D"font-family: times new =
roman; font-size: 16px; "><SPAN class=3D"Apple-style-span" =
style=3D"font-family: times new roman; font-size: 16px; ">>> pgsql =
and install as binaries using YUM)</SPAN><BR style=3D"font-family: times =
new roman; font-size: 16px; "><SPAN class=3D"Apple-style-span" =
style=3D"font-family: times new roman; font-size: 16px; ">>> =
Postgres 8.1.4</SPAN><BR style=3D"font-family: times new roman; =
font-size: 16px; "><SPAN class=3D"Apple-style-span" style=3D"font-family: =
times new roman; font-size: 16px; ">>></SPAN><BR =
style=3D"font-family: times new roman; font-size: 16px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">>> This scripts works:</SPAN><BR =
style=3D"font-family: times new roman; font-size: 16px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">>> =
------------------------------------------------------------ --------- =
</SPAN><BR style=3D"font-family: times new roman; font-size: 16px; =
"><SPAN class=3D"Apple-style-span" style=3D"font-family: times new =
roman; font-size: 16px; ">>> ------------</SPAN><BR =
style=3D"font-family: times new roman; font-size: 16px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">>> <?php</SPAN><BR style=3D"font-family: =
times new roman; font-size: 16px; "><SPAN class=3D"Apple-style-span" =
style=3D"font-family: times new roman; font-size: 16px; ">>> // =
Connecting, selecting database</SPAN><BR style=3D"font-family: times new =
roman; font-size: 16px; "><SPAN class=3D"Apple-style-span" =
style=3D"font-family: times new roman; font-size: 16px; ">>> =
$dbconn =3D pg_connect("host=3Dlocalhost dbname=3Ddatabase =
user=3Dweb")</SPAN><BR style=3D"font-family: times new roman; font-size: =
16px; "><SPAN class=3D"Apple-style-span" style=3D"font-family: times new =
roman; font-size: 16px; ">>>=A0=A0=A0=A0or die('Could not connect: =
' . pg_last_error());</SPAN><BR style=3D"font-family: times new roman; =
font-size: 16px; "><SPAN class=3D"Apple-style-span" style=3D"font-family: =
times new roman; font-size: 16px; ">>></SPAN><BR =
style=3D"font-family: times new roman; font-size: 16px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">>> // Performing SQL query</SPAN><BR =
style=3D"font-family: times new roman; font-size: 16px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">>> $query =3D 'SELECT * FROM foobar limit =
16';</SPAN><BR style=3D"font-family: times new roman; font-size: 16px; =
"><SPAN class=3D"Apple-style-span" style=3D"font-family: times new =
roman; font-size: 16px; ">></SPAN><BR style=3D"font-family: times new =
roman; font-size: 16px; "><SPAN class=3D"Apple-style-span" =
style=3D"font-family: times new roman; font-size: 16px; ">> =
<snip></SPAN><BR style=3D"font-family: times new roman; font-size: =
16px; "><SPAN class=3D"Apple-style-span" style=3D"font-family: times new =
roman; font-size: 16px; ">></SPAN><BR style=3D"font-family: times new =
roman; font-size: 16px; "><SPAN class=3D"Apple-style-span" =
style=3D"font-family: times new roman; font-size: 16px; ">>>=A0=A0//=
Performing SQL query</SPAN><BR style=3D"font-family: times new roman; =
font-size: 16px; "><SPAN class=3D"Apple-style-span" style=3D"font-family: =
times new roman; font-size: 16px; ">>>=A0=A0$query =3D 'SELECT * =
FROM foobar limit 17';</SPAN><BR style=3D"font-family: times new roman; =
font-size: 16px; "><SPAN class=3D"Apple-style-span" style=3D"font-family: =
times new roman; font-size: 16px; ">></SPAN><BR style=3D"font-family: =
times new roman; font-size: 16px; "><SPAN class=3D"Apple-style-span" =
style=3D"font-family: times new roman; font-size: 16px; ">> That =
seems really weird.</SPAN><BR style=3D"font-family: times new roman; =
font-size: 16px; "><SPAN class=3D"Apple-style-span" style=3D"font-family: =
times new roman; font-size: 16px; ">></SPAN><BR style=3D"font-family: =
times new roman; font-size: 16px; "><SPAN class=3D"Apple-style-span" =
style=3D"font-family: times new roman; font-size: 16px; ">> If you =
run those through psql natively what happens?</SPAN><BR =
style=3D"font-family: times new roman; font-size: 16px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">></SPAN><BR style=3D"font-family: times new roman; =
font-size: 16px; "><SPAN class=3D"Apple-style-span" style=3D"font-family: =
times new roman; font-size: 16px; ">> -- </SPAN><BR =
style=3D"font-family: times new roman; font-size: 16px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">> Postgresql & php tutorials</SPAN><BR =
style=3D"font-family: times new roman; font-size: 16px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">> </SPAN><A target=3D"_blank" =
href=3D"http://www.designmagick.com/"><SPAN class=3D"Apple-style-span" =
style=3D"color: rgb(0, 0, 238); font-family: times new roman; font-size: =
16px; -khtml-text-decorations-in-effect: underline; =
">http://www.designmagick.com/</SPAN></A><BR style=3D"font-family: times =
new roman; font-size: 16px; "><SPAN class=3D"Apple-style-span" =
style=3D"font-family: times new roman; font-size: 16px; ">></SPAN><BR =
style=3D"font-family: times new roman; font-size: 16px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">></SPAN><BR style=3D"font-family: times new roman; =
font-size: 16px; "><SPAN class=3D"Apple-style-span" style=3D"font-family: =
times new roman; font-size: 16px; ">></SPAN><BR style=3D"font-family: =
times new roman; font-size: 16px; "><SPAN class=3D"Apple-style-span" =
style=3D"font-family: times new roman; font-size: 16px; ">></SPAN><BR =
style=3D"font-family: times new roman; font-size: 16px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">> ---------------------------(end of=A0=A0</SPAN><BR=
style=3D"font-family: times new roman; font-size: 16px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">> broadcast)---------------------------</SPAN><BR =
style=3D"font-family: times new roman; font-size: 16px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">> TIP 6: explain analyze is your friend</SPAN><BR =
style=3D"font-family: times new roman; font-size: 16px; "><BR =
style=3D"font-family: times new roman; font-size: 16px; "><BR =
style=3D"font-family: times new roman; font-size: 16px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">---------------------------(end of =
broadcast)---------------------------</SPAN><BR style=3D"font-family: =
times new roman; font-size: 16px; "><SPAN class=3D"Apple-style-span" =
style=3D"font-family: times new roman; font-size: 16px; ">TIP 9: In =
versions below 8.0, the planner will ignore your desire to</SPAN><BR =
style=3D"font-family: times new roman; font-size: 16px; "><SPAN =
class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">=A0=A0=A0=A0=A0=A0 choose an index scan if your =
joining column's datatypes do not</SPAN><BR style=3D"font-family: times =
new roman; font-size: 16px; "><SPAN class=3D"Apple-style-span" =
style=3D"font-family: times new roman; font-size: 16px; ">=A0=A0=A0=A0=A0=A0=
match</SPAN><BR style=3D"font-family: times new roman; font-size: 16px; =
"></DIV></DIV><BR style=3D"font-family: arial; font-size: 16px; =
"></DIV></DIV><BR =
class=3D"Apple-interchange-newline"></SPAN></BLOCKQUOTE></DIV><BR></DIV></=
BODY></HTML>=

--Apple-Mail-3-504461470--
gmr [ Do, 31 August 2006 21:33 ] [ ID #1451228 ]

Re: Postgres 8.1.4 + PHP, hangs when querying more than 16 records!

--0-1526541721-1157054879=:30221
Content-Type: text/plain; charset=us-ascii

Yeah, I just dumped the box completely. It was too frustrating. I'm starting over with FreeBSD this time on new hardware.

Thanks for your help and suggestions!

----- Original Message ----
From: Gavin M. Roy <gmr [at] ehpg.net>
To: babak badaei <badaei [at] yahoo.com>
Cc: pgsql-php [at] postgresql.org
Sent: Thursday, August 31, 2006 12:33:24 PM
Subject: Re: [PHP] Postgres 8.1.4 + PHP, hangs when querying more than 16 records!

Wow I'd say that something is terribly wrong with your machine, or it's install of pgsql, other than running fedora ;-). Out of curiosity what's the row size? how many fields and what's the schema look like?






On Aug 31, 2006, at 9:29 AM, babak badaei wrote:

Hello again; I just finished trying the method below with the same results. 16 records work, more than that it hangs!! Thanks for your help. Babak.

----- Original Message ----
From: Gavin M. Roy <gmr [at] ehpg.net>
To: babak badaei <badaei [at] yahoo.com>
Cc: pgsql-php [at] postgresql.org
Sent: Thursday, August 31, 2006 8:55:01 AM
Subject: Re: [PHP] Postgres 8.1.4 + PHP, hangs when querying more than 16 records!

Have you tried with pdo?

$pdo = new PDO('pgsql:host=localhost;dbname=database','web');
$query = $pdo->query('SELECT * FROM foobar;');
$query->execute();
$data = $query->fetchAll(PDO::FETCH_OBJ);
print_r($data);

And have you tried not using other peoples packages but downloading
the source and compiling it? I run PHP 5.1.4 and work with very
large data sets, though I've not upgraded to 5.1.6 yet.

Hope this helps,

Gavin


On Aug 31, 2006, at 12:42 AM, babak badaei wrote:

> Hi Chris, Run through the native client everything works fine. I
> know, its really strange. Any ideas?
>
> ----- Original Message ----
> From: Chris <dmagick [at] gmail.com>
> To: babak badaei <badaei [at] yahoo.com>
> Cc: pgsql-php [at] postgresql.org
> Sent: Wednesday, August 30, 2006 11:42:01 PM
> Subject: Re: [PHP] Postgres 8.1.4 + PHP, hangs when querying more
> than 16 records!
>
> babak badaei wrote:
>> 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';
>
> <snip>
>
>> // Performing SQL query
>> $query = 'SELECT * FROM foobar limit 17';
>
> That seems really weird.
>
> If you run those through psql natively what happens?
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>
>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 6: explain analyze is your friend


---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match













--0-1526541721-1157054879=:30221
Content-Type: text/html; charset=us-ascii

<html><head><style type="text/css"><!-- DIV {margin:0px} --></style></head><body><div style="font-family:arial, helvetica, sans-serif;font-size:12pt"><div style="font-family: arial,helvetica,sans-serif; font-size: 12pt;">Yeah, I just dumped the box completely. It was too frustrating. I'm starting over with FreeBSD this time on new hardware. <br><br>Thanks for your help and suggestions!<br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: Gavin M. Roy <gmr [at] ehpg.net><br>To: babak badaei <badaei [at] yahoo.com><br>Cc: pgsql-php [at] postgresql.org<br>Sent: Thursday, August 31, 2006 12:33:24 PM<br>Subject: Re: [PHP] Postgres 8.1.4 + PHP, hangs when querying more than 16 records!<br><br>Wow I'd say that something is terribly wrong with your machine, or it's install of pgsql, other than running fedora ;-).  Out of c
uriosity what's the row size?  how many fields and what's the schema look
like?<div><br class="khtml-block-placeholder"></div><div><br class="khtml-block-placeholder"></div><div><br class="khtml-block-placeholder"></div><div><br><div><div>On Aug 31, 2006, at 9:29 AM, babak badaei wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px;"><div style="font-family: arial; font-size: 16px;"><div style="font-family: arial; font-size: 16px;"><span class="Apple-style-span" style="font-family: arial; font-size: 16px;">Hello again; I just finished trying the method below with the same results. 16 rec
ords work, more than that it hangs!! Thanks for your help. Babak.</span><br
style="font-family: arial; font-size: 16px;"><br style="font-family: arial; font-size: 16px;"><div style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">----- Original Message ----</span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">From: Gavin M. Roy <<a id="bodyLinks" rel="nofollow" target="_blank" href="mailto:gmr [at] ehpg.net">gmr [at] ehpg.net</a>></span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">To: babak badaei <<a id="bodyLinks" rel="nofollow" target="_blank" href="mailto:badaei [at] yahoo.com">badaei [at] yahoo.com</a>></span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple
-style-span" style="font-family: times new roman; font-size: 16px;">Cc: <a
id="bodyLinks" rel="nofollow" target="_blank" href="mailto:pgsql-php [at] postgresql.org">pgsql-php [at] postgresql. org</a></span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">Sent: Thursday, August 31, 2006 8:55:01 AM</span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">Subject: Re: [PHP] Postgres 8.1.4 + PHP, hangs when querying more than 16 records!</span><br style="font-family: times new roman; font-size: 16px;"><br style="font-family: times new roman; font-size: 16px;"><div style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">Have you tried with pdo?</span><br style="font-family: times new roman; font-size: 16px
;"><br style="font-family: times new roman; font-size: 16px;"><span
class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">$pdo = new PDO('pgsql:host=localhost;dbname=database','web');</span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">$query = $pdo->query('SELECT * FROM foobar;');</span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">$query->execute();</span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">$data = $query->fetchAll(PDO::FETCH_OBJ);</span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">print_r($data);</span><br style="fon
t-family: times new roman; font-size: 16px;"><br style="font-family: times new roman;
font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">And have you tried not using other peoples packages but downloading  </span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">the source and compiling it?  I run PHP 5.1.4 and work with very  </span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">large data sets, though I've not upgraded to 5.1.6 yet.</span><br style="font-family: times new roman; font-size: 16px;"><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">Hope this helps,</span><br style="font-family: times new rom
an; font-size: 16px;"><br style="font-family: times new roman; font-size: 16px;"><span
class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">Gavin</span><br style="font-family: times new roman; font-size: 16px;"><br style="font-family: times new roman; font-size: 16px;"><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">On Aug 31, 2006, at 12:42 AM, babak badaei wrote:</span><br style="font-family: times new roman; font-size: 16px;"><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">> Hi Chris, Run through the native client everything works fine. I  </span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">> know, its really strange. Any ideas?</span><br
style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span"
style="font-family: times new roman; font-size: 16px;">></span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">> ----- Original Message ----</span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">> From: Chris <<a id="bodyLinks" rel="nofollow" target="_blank" href="mailto:dmagick [at] gmail.com">dmagick [at] gmail.com</a>></span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">> To: babak badaei <<a id="bodyLinks" rel="nofollow" target="_blank" href="mailto:badaei [at] yahoo.com">badaei [at] yahoo.com</a>></span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span
" style="font-family: times new roman; font-size: 16px;">> Cc: <a id="bodyLinks"
rel="nofollow" target="_blank" href="mailto:pgsql-php [at] postgresql.org">pgsql-php [at] postgresql. org</a></span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">> Sent: Wednesday, August 30, 2006 11:42:01 PM</span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">> Subject: Re: [PHP] Postgres 8.1.4 + PHP, hangs when querying more  </span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">> than 16 records!</span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">></span><br style="font-family: times
new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times
new roman; font-size: 16px;">> babak badaei wrote:</span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">>> OS: Fedora Core 5</span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">>> PHP: PHP 5.1.4, PHP 5.1.6, and  PHP 4.4.4 (compiled with --with- </span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">>> pgsql and install as binaries using YUM)</span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">>> Postgres 8.1.4</span><br style="font-family: times new roman; font-siz
e: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size:
16px;">>></span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">>> This scripts works:</span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">>> ------------------------------------------------------------ --------- </span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">>> ------------</span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">>> <?php</span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roma
n; font-size: 16px;">>> // Connecting, selecting database</span><br
style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">>> $dbconn = pg_connect("host=localhost dbname=database user=web")</span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">>>    or die('Could not connect: ' . pg_last_error());</span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">>></span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">>> // Performing SQL query</span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-f
amily: times new roman; font-size: 16px;">>> $query = 'SELECT * FROM foobar limit
16';</span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">></span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">> <snip></span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">></span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">>>  // Performing SQL query</span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">>>  $query = 'SELECT * FROM foobar limit 17';</span
><br style="font-family: times new roman; font-size: 16px;"><span
class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">></span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">> That seems really weird.</span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">></span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">> If you run those through psql natively what happens?</span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">></span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-fami
ly: times new roman; font-size: 16px;">> -- </span><br style="font-family: times new
roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">> Postgresql & php tutorials</span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">> </span><a id="bodyLinks" rel="nofollow" target="_blank" href="http://www.designmagick.com/"><span class="Apple-style-span" style="color: rgb(0, 0, 238); font-family: times new roman; font-size: 16px;">http://www.designmagick.com/</span></a><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">></span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">></span><br style="font-family: times new roman; fon
t-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman;
font-size: 16px;">></span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">></span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">> ---------------------------(end of  </span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">> broadcast)---------------------------</span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">> TIP 6: explain analyze is your friend</span><br style="font-family: times new roman; font-size: 16px;"><br style="font-family: times new roman; font-size: 16px;"><br s
tyle="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span"
style="font-family: times new roman; font-size: 16px;">---------------------------(end of broadcast)---------------------------</span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">TIP 9: In versions below 8.0, the planner will ignore your desire to</span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">       choose an index scan if your joining column's datatypes do not</span><br style="font-family: times new roman; font-size: 16px;"><span class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">       match</span><br style="font-family: times new roman; font-size: 16px;"></div></div><br style="font-family: arial
; font-size: 16px;"></div></div><br
class="Apple-interchange-newline"></span></blockquote></div><br></div></div><br></div></div></body></html>
--0-1526541721-1157054879=:30221--
babak badaei [ Do, 31 August 2006 22:07 ] [ ID #1451229 ]
Datenbanken » gmane.comp.db.postgresql.php » Postgres 8.1.4 + PHP, hangs when querying more than 16 records!

Vorheriges Thema: binary cursor returning truncated data
Nächstes Thema: Fw: Postgres 8.1.4 + PHP, hangs when querying more than 16 records!