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

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

am 31.08.2006 08:25:58 von babak badaei

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:
------------------------------------------------------------ ---------------------
// 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 "

\n";
while ($line = pg_fetch_array($result, null, PGSQL_ASSOC)) {
echo "\t\n";
foreach ($line as $col_value) {
echo "\t\t\n";
}
echo "\t\n";
}
echo "
$col_value
\n";

// Free resultset
pg_free_result($result);

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

------------------------------------------------------------ -----------------------
// 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 "\n";
while ($line = pg_fetch_array($result, null, PGSQL_ASSOC)) {
echo "\t\n";
foreach ($line as $col_value) {
echo "\t\t\n";
}
echo "\t\n";
}
echo "
$col_value
\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

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

am 31.08.2006 08:42:01 von Chris

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:
> ------------------------------------------------------------ ---------------------
> > // 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';



> // 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

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

am 31.08.2006 09:42:06 von babak badaei

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

----- Original Message ----
From: Chris
To: babak badaei
Cc: pgsql-php@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:
> ------------------------------------------------------------ ---------------------
> > // 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';



> // 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

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

am 31.08.2006 17:55:01 von gmr

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
> To: babak badaei
> Cc: pgsql-php@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:
>> ------------------------------------------------------------ ---------
>> ------------
>> >> // 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';
>
>
>
>> // 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

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

am 31.08.2006 18:15:27 von babak badaei

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
To: babak badaei
Cc: pgsql-php@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
> To: babak badaei
> Cc: pgsql-php@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:
>> ------------------------------------------------------------ ---------
>> ------------
>> >> // 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';
>
>
>
>> // 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@postgresql.org so that your
message can get through to the mailing list cleanly

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

am 31.08.2006 18:29:10 von babak badaei

--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
To: babak badaei
Cc: pgsql-php@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
> To: babak badaei
> Cc: pgsql-php@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:
>> ------------------------------------------------------------ ---------
>> ------------
>> >> // 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';
>
>
>
>> // 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

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@ehpg.net>
To: babak badaei <badaei@yahoo.com>
Cc: pgsql-php@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@gmail.com>
> To: babak badaei <badaei@yahoo.com>
> Cc: pgsql-php@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?
>
> --
> Po
stgresql & php tutorials
> href="http://www.designmagick.com/">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--

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

am 31.08.2006 21:33:24 von gmr

--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
> To: babak badaei
> Cc: pgsql-php@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
> > To: babak badaei
> > Cc: pgsql-php@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:
> >>
> ------------------------------------------------------------ ---------
> >> ------------
> >> > >> // 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';
> >
> >
> >
> >> // 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

-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?


class=3D"khtml-block-placeholder">

class=3D"khtml-block-placeholder">

class=3D"khtml-block-placeholder">

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

class=3D"Apple-interchange-newline">
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; ">
style=3D"font-family:arial, helvetica, sans-serif;font-size:12pt; =
font-family: arial; font-size: 16px; ">
arial,helvetica,sans-serif; font-size: 12pt;; font-family: arial; =
font-size: 16px; "> 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.

font-size: 16px; ">
">
font-size: 12pt;; font-family: times new roman; font-size: 16px; "> class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">----- Original Message ----

style=3D"font-family: times new roman; font-size: 16px; "> class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">From: Gavin M. Roy < href=3D"mailto:gmr@ehpg.net">gmr@ehpg.net>

style=3D"font-family: times new roman; font-size: 16px; "> class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">To: babak badaei < href=3D"mailto:badaei@yahoo.com">badaei@yahoo.com>

style=3D"font-family: times new roman; font-size: 16px; "> class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">Cc: href=3D"mailto:pgsql-php@postgresql.org">pgsql-php@postgresq l.org N>
class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">Sent: Thursday, August 31, 2006 8:55:01 AM

style=3D"font-family: times new roman; font-size: 16px; "> 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!

roman; font-size: 16px; ">
font-size: 16px; ">
font-size: 16px; "> times new roman; font-size: 16px; ">Have you tried with pdo?
style=3D"font-family: times new roman; font-size: 16px; ">
style=3D"font-family: times new roman; font-size: 16px; "> 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');

style=3D"font-family: times new roman; font-size: 16px; "> class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">$query =3D $pdo->query('SELECT * FROM =
foobar;');

16px; "> roman; font-size: 16px; ">$query->execute();
style=3D"font-family: times new roman; font-size: 16px; "> class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">$data =3D =
$query->fetchAll(PDO::FETCH_OBJ);

times new roman; font-size: 16px; "> style=3D"font-family: times new roman; font-size: 16px; =
">print_r($data);

font-size: 16px; ">
16px; "> roman; font-size: 16px; ">And have you tried not using other peoples =
packages but downloading  

roman; font-size: 16px; "> style=3D"font-family: times new roman; font-size: 16px; ">the source and =
compiling it?  I run PHP 5.1.4 and work with very  

style=3D"font-family: times new roman; font-size: 16px; "> 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.

">
class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">Hope this helps,

times new roman; font-size: 16px; ">
roman; font-size: 16px; "> style=3D"font-family: times new roman; font-size: 16px; =
">Gavin

16px; ">
">
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:

">
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  

roman; font-size: 16px; "> style=3D"font-family: times new roman; font-size: 16px; ">> know, its =
really strange. Any ideas?

roman; font-size: 16px; "> style=3D"font-family: times new roman; font-size: 16px; ">>
style=3D"font-family: times new roman; font-size: 16px; "> class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">> ----- Original Message ----

style=3D"font-family: times new roman; font-size: 16px; "> class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">> From: Chris < href=3D"mailto:dmagick@gmail.com">dmagick@gmail.com>

style=3D"font-family: times new roman; font-size: 16px; "> class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">> To: babak badaei < href=3D"mailto:badaei@yahoo.com">badaei@yahoo.com>

style=3D"font-family: times new roman; font-size: 16px; "> class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">> Cc: href=3D"mailto:pgsql-php@postgresql.org">pgsql-php@postgresq l.org N>
class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">> Sent: Wednesday, August 30, 2006 11:42:01 =
PM

"> roman; font-size: 16px; ">> Subject: Re: [PHP] Postgres 8.1.4 + PHP, =
hangs when querying more  

roman; font-size: 16px; "> style=3D"font-family: times new roman; font-size: 16px; ">> than 16 =
records!

16px; "> roman; font-size: 16px; ">>
roman; font-size: 16px; "> style=3D"font-family: times new roman; font-size: 16px; ">> babak =
badaei wrote:

font-size: 16px; "> times new roman; font-size: 16px; ">>> OS: Fedora Core 5
style=3D"font-family: times new roman; font-size: 16px; "> 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  PHP =
4.4.4 (compiled with --with-

roman; font-size: 16px; "> style=3D"font-family: times new roman; font-size: 16px; ">>> pgsql =
and install as binaries using YUM)

new roman; font-size: 16px; "> style=3D"font-family: times new roman; font-size: 16px; ">>> =
Postgres 8.1.4

font-size: 16px; "> times new roman; font-size: 16px; ">>>
style=3D"font-family: times new roman; font-size: 16px; "> class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">>> This scripts works:

style=3D"font-family: times new roman; font-size: 16px; "> class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">>> =
------------------------------------------------------------ --------- =

"> roman; font-size: 16px; ">>> ------------
style=3D"font-family: times new roman; font-size: 16px; "> class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">>> <?php

times new roman; font-size: 16px; "> style=3D"font-family: times new roman; font-size: 16px; ">>> // =
Connecting, selecting database

roman; font-size: 16px; "> style=3D"font-family: times new roman; font-size: 16px; ">>> =
$dbconn =3D pg_connect("host=3Dlocalhost dbname=3Ddatabase =
user=3Dweb")

16px; "> roman; font-size: 16px; ">>>    or die('Could not connect: =
' . pg_last_error());

font-size: 16px; "> times new roman; font-size: 16px; ">>>
style=3D"font-family: times new roman; font-size: 16px; "> class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">>> // Performing SQL query

style=3D"font-family: times new roman; font-size: 16px; "> class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">>> $query =3D 'SELECT * FROM foobar limit =
16';

"> roman; font-size: 16px; ">>
roman; font-size: 16px; "> style=3D"font-family: times new roman; font-size: 16px; ">> =
<snip>

16px; "> roman; font-size: 16px; ">>
roman; font-size: 16px; "> style=3D"font-family: times new roman; font-size: 16px; ">>>  //=
Performing SQL query

font-size: 16px; "> times new roman; font-size: 16px; ">>>  $query =3D 'SELECT * =
FROM foobar limit 17';

font-size: 16px; "> times new roman; font-size: 16px; ">>
times new roman; font-size: 16px; "> style=3D"font-family: times new roman; font-size: 16px; ">> That =
seems really weird.

font-size: 16px; "> times new roman; font-size: 16px; ">>
times new roman; font-size: 16px; "> style=3D"font-family: times new roman; font-size: 16px; ">> If you =
run those through psql natively what happens?

style=3D"font-family: times new roman; font-size: 16px; "> class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">>

font-size: 16px; "> times new roman; font-size: 16px; ">> --
style=3D"font-family: times new roman; font-size: 16px; "> class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">> Postgresql & php tutorials

style=3D"font-family: times new roman; font-size: 16px; "> class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">>
href=3D"http://www.designmagick.com/"> 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/

new roman; font-size: 16px; "> style=3D"font-family: times new roman; font-size: 16px; ">>
style=3D"font-family: times new roman; font-size: 16px; "> class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">>

font-size: 16px; "> times new roman; font-size: 16px; ">>
times new roman; font-size: 16px; "> style=3D"font-family: times new roman; font-size: 16px; ">>
style=3D"font-family: times new roman; font-size: 16px; "> class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">> ---------------------------(end of  
style=3D"font-family: times new roman; font-size: 16px; "> class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">> broadcast)---------------------------

style=3D"font-family: times new roman; font-size: 16px; "> class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">> TIP 6: explain analyze is your friend

style=3D"font-family: times new roman; font-size: 16px; ">
style=3D"font-family: times new roman; font-size: 16px; ">
style=3D"font-family: times new roman; font-size: 16px; "> class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">---------------------------(end of =
broadcast)---------------------------

times new roman; font-size: 16px; "> style=3D"font-family: times new roman; font-size: 16px; ">TIP 9: In =
versions below 8.0, the planner will ignore your desire to

style=3D"font-family: times new roman; font-size: 16px; "> class=3D"Apple-style-span" style=3D"font-family: times new roman; =
font-size: 16px; ">       choose an index scan if your =
joining column's datatypes do not

new roman; font-size: 16px; "> style=3D"font-family: times new roman; font-size: 16px; ">      =
match

">

">

class=3D"Apple-interchange-newline">

BODY>=

--Apple-Mail-3-504461470--

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

am 31.08.2006 22:07:59 von babak badaei

--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
To: babak badaei
Cc: pgsql-php@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
To: babak badaei
Cc: pgsql-php@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
> To: babak badaei
> Cc: pgsql-php@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:
>> ------------------------------------------------------------ ---------
>> ------------
>> >> // 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';
>
>
>
>> // 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

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@ehpg.net>
To: babak badaei <badaei@yahoo.com>
Cc: pgsql-php@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 c
uriosity 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 rec
ords work, more than that it hangs!! Thanks for your help. Babak.
style="font-family: arial; font-size: 16px;">
----- Original Message ----
From: Gavin M. Roy <>
Cc: id="bodyLinks" rel="nofollow" target="_blank" href="mailto:pgsql-php@postgresql.org">pgsql-php@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?

class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">$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,

class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">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? style="font-family: times new roman; font-size: 16px;"> style="font-family: times new roman; font-size: 16px;">>
> ----- Original Message ----
> From: Chris <>
> Cc: rel="nofollow" target="_blank" href="mailto:pgsql-php@postgresql.org">pgsql-php@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 style="font-family: times new roman; font-size: 16px;">>> $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';
>
class="Apple-style-span" style="font-family: times new roman; font-size: 16px;">>
> That seems really weird.
>
> If you run those through psql natively what happens?
>
> --
> Postgresql & php tutorials
>
>
>
>
>
> ---------------------------(end of  
> broadcast)---------------------------
> TIP 6: explain analyze is your friend


tyle="font-family: times new roman; font-size: 16px;"> style="font-family: times new roman; font-size: 16px;">---------------------------(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

class="Apple-interchange-newline">



--0-1526541721-1157054879=:30221--