From MySQL to PostgreSQL

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)

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

http://www.postgresql.org/docs/faq
Zouari Fourat [ Di, 22 Februar 2005 12:07 ] [ ID #657913 ]

Re: From MySQL to PostgreSQL

--VywGB/WGlW4DM4P8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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()


--VywGB/WGlW4DM4P8
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFCGxwAlA+/TuXKaj0RAv/JAJ4hftR3bcm2rrHawoIRbP7dkPZrLQCg qLLt
/5Zt8dfYAPPLDR8ShhnPzEA=
=cI6R
-----END PGP SIGNATURE-----

--VywGB/WGlW4DM4P8--
Mariusz Pekala [ Di, 22 Februar 2005 12:48 ] [ ID #657914 ]
Datenbanken » gmane.comp.db.postgresql.php » From MySQL to PostgreSQL

Vorheriges Thema: PostgreSQL encoding
Nächstes Thema: Example Scripts