Re: [PHP] pg_query and COPY in transaction

2006-07-19 Thread Jochem Maas
Luis Magaña wrote: > I've found the problem and this is not a PHP issue with the pg_query > function at all. > > It turned out the COPY command was executing properly since the > specified file for copying records was empty, therefore the COPY was not > issuing any error as it should be. LOL. It'

Re: [PHP] pg_query and COPY in transaction

2006-07-19 Thread Luis Magaña
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I've found the problem and this is not a PHP issue with the pg_query function at all. It turned out the COPY command was executing properly since the specified file for copying records was empty, therefore the COPY was not issuing any error as it shou

Re: [PHP] pg_query and COPY in transaction

2006-07-19 Thread David Tulloh
Luis Magaña wrote: > I have the following code: > > pg_query($conn,"BEGIN TRANSACTION; > DELETE FROM codigo_postal; > COPY > codigo_postal(codigo_postal,asentamiento,tipo_asentamiento,municipio,estado) > FROM '$tmpfname2' DELIMITER '|'; > COMMIT"); > > It is suppouse

Re: [PHP] pg_query and COPY in transaction

2006-07-18 Thread Chris
Luis Magaña wrote: I have the following code: pg_query($conn,"BEGIN TRANSACTION; DELETE FROM codigo_postal; COPY codigo_postal(codigo_postal,asentamiento,tipo_asentamiento,municipio,estado) FROM '$tmpfname2' DELIMITER '|'; COMMIT"); Separate them out as a first st

Re: [PHP] pg_query and COPY in transaction

2006-07-18 Thread Jochem Maas
Luis Magaña wrote: > It is a PHP question because the Postgres querys do work, I ran them > directly on the postgres server and there is no problem, but if you use > pg_query then it does not work, and pg_query is a PHP function, is it no t? > > Any way, I've tried already giving each query in sep

Re: [PHP] pg_query and COPY in transaction

2006-07-18 Thread Luis Magaña
It is a PHP question because the Postgres querys do work, I ran them directly on the postgres server and there is no problem, but if you use pg_query then it does not work, and pg_query is a PHP function, is it no t? Any way, I've tried already giving each query in separate function calls, and it

Re: [PHP] pg_query and COPY in transaction

2006-07-18 Thread Jochem Maas
Luis Magaña wrote: > I have the following code: > > pg_query($conn,"BEGIN TRANSACTION; > DELETE FROM codigo_postal; > COPY > codigo_postal(codigo_postal,asentamiento,tipo_asentamiento,municipio,estado) > FROM '$tmpfname2' DELIMITER '|'; > COMMIT"); > > It is suppouse

[PHP] pg_query and COPY in transaction

2006-07-18 Thread Luis Magaña
I have the following code: pg_query($conn,"BEGIN TRANSACTION; DELETE FROM codigo_postal; COPY codigo_postal(codigo_postal,asentamiento,tipo_asentamiento,municipio,estado) FROM '$tmpfname2' DELIMITER '|'; COMMIT"); It is suppoused as I understand it, that if an error

Re: [PHP] pg_query

2004-02-25 Thread Michal Migurski
>I have a small question about sending PostgreSQL commands/statements. I >noticed that there's a function pg_insert that can insert rows, but I >have also seen codes that use pg_query(pg_exec, actually) to do the same >job(in phpBB). Since 'query' is defined to 'retrieve' data, is it more >preferre

[PHP] pg_query

2004-02-25 Thread Moo
Hi There, I have a small question about sending PostgreSQL commands/statements. I noticed that there's a function pg_insert that can insert rows, but I have also seen codes that use pg_query(pg_exec, actually) to do the same job(in phpBB). Since 'query' is defined to 'retrieve' data, is it more pre