On Thu, Jan 29, 2009 at 04:01:40PM -0400, Devan Goodwin wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Working on the population of PostgreSQL schema in
> spacewalk-setup I landed in rhn-populate-database.pl, got the
> script ready to populate pgsql schema as well but even if the
> schema population fails miserably, the psql executable returns a
> 0 success code.
> 
> Anyone have ideas for a good way to progrematically check if the
> population was successful?

Can't you check back (with select) that whatever is the last
command in $schema_deploy_file got executed properly? For example,
that the version of the schema got actually set?

> For the record the population code looks like:
> 
> my $psql_cmd = "PGPASSWORD=" . $password . " psql -U " .
> $user . " -h " . $host . " " . $database . " < " . $schema_deploy_file;
> $pid = open3(gensym, ">&LOGFILE", ">&LOGFILE", $psql_cmd);

If you use open3, please, please, please, do not join. Two months
from now we'll be again having a bugzilla when someone has ', or ",
or & in their password.

-- 
Jan Pazdziora | adelton at #satellite*, #brno
Satellite Engineering, Red Hat

_______________________________________________
Spacewalk-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to