Subject: createdb in libpq

From: [email-masked] (Bernd Froehlich)
Date: Thu, 28 Jul 94 10:41:02 +0200

Is it somehow possible to create a new database from inside a C-program?

==============================================================================
   To add/remove yourself to/from the POSTGRES mailing list: send mail with 
   the subject line ADD or DEL to "[email-masked]"

   If this fails, send mail to "[email-masked]" and
   a human will deal with it.  DO NOT post to the "postgres" mailing list.
==============================================================================

---

From: [email-masked] (Paul M. Aoki)
Date: Thu, 28 Jul 94 11:46:08 -0700

> Is it somehow possible to create a new database from inside a C-program?

the trivial way is to run the usual "createdb" script using system(3)
or popen(3) or something.

the almost-as-trivial way is to look at the createdb script and do what 
it does -- attach to template1, and run a "createdb" query.
--
  Paul M. Aoki          |  University of California at Berkeley
  [email-masked]  |  Dept. of EECS, Computer Science Division (#1776) 
                        |  Berkeley, CA 94720-1776