pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From MySQL to PostgreSQL
3+ messages / 3 participants
[nested] [flat]

* From MySQL to PostgreSQL
@ 2005-02-22 11:07 Zouari Fourat <fourat@gmail.com>
  2005-02-22 11:48 ` Re: From MySQL to PostgreSQL Mariusz Pękala <skoot@qi.pl>
  0 siblings, 1 reply; 3+ messages in thread

From: Zouari Fourat @ 2005-02-22 11:07 UTC (permalink / raw)
  To: pgsql-php

Am just migrating from mysql db to pgsql db, an want to ask about some
clarifications on the php pgsql api :

*> is pg_fetch_all faster than iterating with pg_fetch_assoc ?
*> how to avoid sql injections, should i use the same methods with
mysql ? (addslashes)



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

* Re: From MySQL to PostgreSQL
  2005-02-22 11:07 From MySQL to PostgreSQL Zouari Fourat <fourat@gmail.com>
@ 2005-02-22 11:48 ` Mariusz Pękala <skoot@qi.pl>
  0 siblings, 0 replies; 3+ messages in thread

From: Mariusz Pękala @ 2005-02-22 11:48 UTC (permalink / raw)
  To: pgsql-php

On 2005-02-22 12:07:39 +0100 (Tue, Feb), Zouari Fourat wrote:
> Am just migrating from mysql db to pgsql db, an want to ask about some
> clarifications on the php pgsql api :
> 
> *> is pg_fetch_all faster than iterating with pg_fetch_assoc ?

You should test. :-)
I believe (I should test too) that it is faster, but with _large_ data sets
you will use a lot of memory, so things will slow down or break.
For known small results (SELECT ... LIMIT ..) why not.

> *> how to avoid sql injections, should i use the same methods with
> mysql ? (addslashes)

No, you should use pg_escape_string()

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

* Fwd: From MySQL to PostgreSQL
@ 2005-02-22 13:38 Matthew Terenzio <matt@jobsforge.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Matthew Terenzio @ 2005-02-22 13:38 UTC (permalink / raw)
  To: pgsql-php


On Feb 22, 2005, at 6:07 AM, Zouari Fourat wrote:

> Am just migrating from mysql db to pgsql db, an want to ask about some
> clarifications on the php pgsql api :
>
> *> is pg_fetch_all faster than iterating with pg_fetch_assoc ?
I think you should be fine with it. According to the manual, 
pg_fect_assoc() is NOT significantly slower than pg_fetch_row.

> *> how to avoid sql injections, should i use the same methods with
> mysql ? (addslashes)

You should use pg_escape_string(), not addslashes.


>
> ---------------------------(end of 
> broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
>                http://www.postgresql.org/docs/faq
>




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


end of thread, other threads:[~2005-02-22 13:38 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-02-22 11:07 From MySQL to PostgreSQL Zouari Fourat <fourat@gmail.com>
2005-02-22 11:48 ` Mariusz Pękala <skoot@qi.pl>
2005-02-22 13:38 Fwd: From MySQL to PostgreSQL Matthew Terenzio <matt@jobsforge.com>

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