pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
PHP, PostgreSQL Extension
2+ messages / 2 participants
[nested] [flat]

* PHP, PostgreSQL Extension
@ 2006-01-01 16:38 Volkan YAZICI <yazicivo@ttnet.net.tr>
  2006-01-03 02:27 ` Re: PHP, PostgreSQL Extension Christopher Kings-Lynne <chriskl@familyhealth.com.au>
  0 siblings, 1 reply; 2+ messages in thread

From: Volkan YAZICI @ 2006-01-01 16:38 UTC (permalink / raw)
  To: pgsql-php

Hi,

Async. functions are introduced in the 5.1.0 release, but in my
opinion, there doesn't exist any supportive functions to use 'em.
Let's discuss this on an example:

  if (!pg_connection_busy($dbconn)) {
    pg_send_query($dbconn, "select * from authors; select count(*) from authors;");
  }

  $res1 = pg_get_result($dbconn);

Above example is brought you from the official pg_get_result()
documentation.

  1. How will we learn whether the data arrived from server or not?
     There doesn't exist any PQsocket() similar function to make
     a socket_select() call on it.

     There're two ways to solve this problem:

     1.1. Pray god to make our queries finished before calling
          pg_get_result().
     
     1.2. Enter to an endless loop bounded by pg_connection_busy().
          Furthermore, you're free to try any adhoc sleep() method
          inside the loop. (Recommended way in the documenation.)

     IMHO, this is a very important missing property in the async.
     functions. Without this, there shouldn't be any place of async.
     queries in a production server.

  2. What if we couldn't transmit whole data out of socket? Is there
     any equivalent for PQflush() or PQconsumeInput()? Yes, there're
     some places in the code which hold PQconsumeInput() calls, but
     shouldn't it be better if we'd mention about this in the
     documentation?

Other issues:

  3. Can somebody explain me the existence of non-standard
     pg_select(), pg_insert(), pg_update() and pg_delete() functions?
     Are there any equivalent of these functions in other PHP
     interfaces? Anyway, this is not the matter. What's the targeted
     crowd in the implementation of these functions? Are there
     any stuff we cannot achieve without using these functions?

  4. I don't want to mention about the not described properties in
     the documentation. (For instance, pg_select() function's options
     parameter.)


Regards.



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: PHP, PostgreSQL Extension
  2006-01-01 16:38 PHP, PostgreSQL Extension Volkan YAZICI <yazicivo@ttnet.net.tr>
@ 2006-01-03 02:27 ` Christopher Kings-Lynne <chriskl@familyhealth.com.au>
  0 siblings, 0 replies; 2+ messages in thread

From: Christopher Kings-Lynne @ 2006-01-03 02:27 UTC (permalink / raw)
  To: Volkan YAZICI <yazicivo@ttnet.net.tr>; +Cc: pgsql-php

> Async. functions are introduced in the 5.1.0 release, but in my
> opinion, there doesn't exist any supportive functions to use 'em.
> Let's discuss this on an example:

No, async functions have been around since PHP 3.x at lest.

>   3. Can somebody explain me the existence of non-standard
>      pg_select(), pg_insert(), pg_update() and pg_delete() functions?
>      Are there any equivalent of these functions in other PHP
>      interfaces? Anyway, this is not the matter. What's the targeted
>      crowd in the implementation of these functions? Are there
>      any stuff we cannot achieve without using these functions?

They exist because PHP development is basically random and generally 
done by random people for random reasons.

Also, why are you mailing this here?  This is a PostgreSQL PHP users 
list, not the PHP developers list.

>   4. I don't want to mention about the not described properties in
>      the documentation. (For instance, pg_select() function's options
>      parameter.)

They might be described on the PostgreSQL extension main page, along 
with all th other constants perhaps.

Chris




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2006-01-03 02:27 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-01-01 16:38 PHP, PostgreSQL Extension Volkan YAZICI <yazicivo@ttnet.net.tr>
2006-01-03 02:27 ` Christopher Kings-Lynne <chriskl@familyhealth.com.au>

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