gnumed-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnumed-devel] bootstrap_db


From: Karsten Hilbert
Subject: [Gnumed-devel] bootstrap_db
Date: Thu, 14 Nov 2002 11:31:27 +0100
User-agent: Mutt/1.3.22.1i

Darn it !

There's two ways to import the schema into our initial
databases:

1) import from within a Python script only

advantage:
 - we have full control over what happens how and when
   with complete access to diagnostics if things fail
 - much better flow control/user interaction

disadvantages:
 - we would have to change our way of defining SQL schemata
   (we currently use psql scripts)
 - we would lose the ability to import things manually with
   psql

2) import with psql (manually or via shell script)

advantage:
 - robust/working way of defining schemata

disadvantage:
 - less control over the whole process
 - little to no user interaction/flow control

The natural solution would be to run psql from within the
Python script via a pipe. But alas, contrary to the man page,
psql does NOT return an errorlevel of 3 upon receiving an
format definition error (bad SQL, usually) from the backend.
Thus the Python script cannot reliably detect whether things
failed or not (short of parsing the output for "ERROR" which
is hardly elegant).

Anyone having any suggestions ?

Karsten
-- 
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346




reply via email to

[Prev in Thread] Current Thread [Next in Thread]