From: Andrew McMillan <andrew@catalyst.net.nz>
To: YC Nyon <ycnyon@pd.jaring.my>
Cc: pgsql-php@postgresql.org
Subject: Re: Can't seem to get Psql and Exec to work together
Date: 07 Nov 2002 21:27:14 +1300
Message-ID: <1036657633.20144.754.camel@kant.mcmillan.net.nz> (raw)
In-Reply-To: <00c901c285b4$37c57490$5340baca@gis>
References: <00c901c285b4$37c57490$5340baca@gis>
On Thu, 2002-11-07 at 05:30, YC Nyon wrote:
> I am trying to run Postgresql's psql using Exec() command.
> The code is below
>
> <?
> $convert_sql_2 = "\"C:\postgresql\bin\psql.exe -d Geoprocessing -f
> C:\\postgresql\\bin\\g126.sql";
> exec($convert_sql_2,$ds);
> ?>
>
> It didn't insert the data I hope it would. I tested it from the dos command
> line and it works fine.
> also i used
> $convert_sql_2 = "\"C:\postgresql\bin\psql.exe --help";
> passthru($convert_sql_2,$ds);
> It works, giving me the help options.
I know that if I tried such foolery on Linux it would not let me because
it would be a different user running the psql - one which was not
allowed to access the database.
Presumably on "DOS" the same sort of thing is happening.
Why not use the pgsql module in PHP and run your commands into
PostgreSQL directly anyway? Doing it the way you suggest here just
seems a recipe for a disaster!
Regards,
Andrew.
--
---------------------------------------------------------------------
Andrew @ Catalyst .Net.NZ Ltd, PO Box 11-053, Manners St, Wellington
WEB: http://catalyst.net.nz/ PHYS: Level 2, 150-154 Willis St
DDI: +64(4)916-7201 MOB: +64(21)635-694 OFFICE: +64(4)499-2267
Survey for nothing with http://survey.net.nz/
---------------------------------------------------------------------
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-php@postgresql.org
Cc: andrew@catalyst.net.nz, ycnyon@pd.jaring.my
Subject: Re: Can't seem to get Psql and Exec to work together
In-Reply-To: <1036657633.20144.754.camel@kant.mcmillan.net.nz>
References: <00c901c285b4$37c57490$5340baca@gis> <1036657633.20144.754.camel@kant.mcmillan.net.nz>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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