Re: [PHP] How can I make postgre execute file with SQL code, on windows platform
Hi Chris, Goal was to get postgre to execute/import an sql dump file, ie not to write import-export functionality myself. In the end, I used piping, something like this: system(type $filename | \C:\Program Files\PostgreSQL\8.1\bin\psql.exe\ -h localhost -p 5432 X6tmp \postgres\); But thanx anyway :) Boban. chris smith wrote: pg_connect($connection_string); pg_query(drop schema public); import data or am I missing something here? You might be better of not doing this with php. Create the dump on the first machine. Copy the dump (scp, rsync, copy via samba-mounted drive, whatever) import it It depends what your end goal is. -- Open source PHP code generator for DB operations http://sourceforge.net/projects/bfrcg/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can I make postgre execute file with SQL code, on windows platform
Goal was to get postgre to execute/import an sql dump file, ie not to write import-export functionality myself. In the end, I used piping, something like this: system(type $filename | \C:\Program Files\PostgreSQL\8.1\bin\psql.exe\ -h localhost -p 5432 X6tmp \postgres\); But thanx anyway :) Boban. Which is why I said: - You might be better of not doing this with php. Create the dump on the first machine. Copy the dump (scp, rsync, copy via samba-mounted drive, whatever) import it - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How can I make postgre execute file with SQL code, on windows platform
Hi all, I need to synchronize two postgresql servers, but synchronization is one-directional (ie, data from one computer needs to be copied to another). Basically, I want the target computer to drop the schema public and then re-create it from my dump made on the source machine. Is there an easy way to do it from PHP, perhaps using some postgre utility via system() call ? Boban. -- Open source PHP code generator for DB operations http://sourceforge.net/projects/bfrcg/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can I make postgre execute file with SQL code, on windows platform
On 2/26/06, Bogdan Ribic [EMAIL PROTECTED] wrote: Hi all, I need to synchronize two postgresql servers, but synchronization is one-directional (ie, data from one computer needs to be copied to another). Basically, I want the target computer to drop the schema public and then re-create it from my dump made on the source machine. Is there an easy way to do it from PHP, perhaps using some postgre utility via system() call ? err pg_connect($connection_string); pg_query(drop schema public); ... import data ... or am I missing something here? You might be better of not doing this with php. Create the dump on the first machine. Copy the dump (scp, rsync, copy via samba-mounted drive, whatever) import it It depends what your end goal is. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php