On Thu, May 11, 2006 at 02:47:33AM -0400, sean finney wrote: > On Wed, May 10, 2006 at 04:47:23PM -0500, John Goerzen wrote: > > For bacula, I need the ability to run a command such as: > > > > ALTER DATABASE bacula SET datestyle TO 'ISO, YMD'; > > > > Now, that database name needs to be the actual database name the user > > has chosen. > > > > I'd like to be able to place a file in install-dbadmin to do this, but > > can't quite work out how to do that. > > you could do this using the install-dbadmin, i think. to get the > name of the database, you can source the > > /etc/dbconfig-common/$package.conf
True enough. But then, I need to do things like manually construct the psql command line with all the proper arguments, decide if I need to su to a particular user first, etc. I think I need to do this as the PostgreSQL superuser (though I haven't tried that yet). In short, it seems to be a complex and error-prone thing to get right. Since you've already got the code in dbconfig-common to fire up psql as the admin user, maybe one option is to just expose that publically. Alternatively, if there would be a way to process a SQL data file like this as a template, and then have dbconfig-common hand that over (either as the superuser or as the newly-created user), that would be even nicer. -- John -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]