X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 6F58B9FA64B for ; Wed, 26 Jul 2006 14:48:34 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 52531-05 for ; Wed, 26 Jul 2006 14:48:25 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sydney.mailnetwork.co.uk (server88-208-192-113.live-servers.net [88.208.192.113]) by postgresql.org (Postfix) with ESMTP id 093139FA6B5 for ; Wed, 26 Jul 2006 14:48:25 -0300 (ADT) Received: from andyshellam-gw.adsl.newnet.co.uk ([80.175.198.137]:41965 helo=[192.168.1.15]) by sydney.mailnetwork.co.uk with esmtpa (Exim 4.60) (envelope-from ) id 1G5nUd-0002fZ-AU; Wed, 26 Jul 2006 18:48:23 +0100 Message-ID: <44C7AAE5.104@andycc.net> Date: Wed, 26 Jul 2006 18:48:21 +0100 From: Andy Shellam Reply-To: andy@andycc.net Organization: the mail network User-Agent: Thunderbird 1.5.0.4 (X11/20060516) MIME-Version: 1.0 To: havedian@ebasetech.com CC: pgsql-admin@postgresql.org Subject: Re: Starting PostgreSQL from a windows application References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.133 tagged_above=0 required=5 tests=FORGED_RCVD_HELO, SPF_HELO_PASS, SPF_PASS X-Spam-Level: X-Archive-Number: 200607/224 X-Sequence-Number: 22470 Hi Hovik: > Hello, > > I have installed Postures on a Windows server and it starts as a > service and all is OK. > > I have 2 questions: > > 1. I need to be able to wrap PostgreSQL as part of my application and, > therefore, start it as part of my app. start-up. I know that pg_ctl > start is the command, but as your documentation clearly states, > PostgreSQL can only be started by a non-privileged user. Here lies my > problem. > Most software needs a privileged user to start it. So how can I start > PostgreSQL as a different user from the one which needs to be logged > in to start the other software? You would need the commands to start and stop a Windows service ("net start " I believe). Does it really matter that PostgreSQL is running while the application isn't? > > 2. How do I give my users a totally new database. Is backup/restore > the only mechanism? > Can I copy (parts of) the data directory, from one installation of > PostgreSQL to another? NO!! Never touch the raw PostgreSQL data files. You could, as part of your application, build in an SQL script of your DB schema, created by "pg_dump --schema-only" that gets run through psql, or piped to an Npgsql .NET library, ODBC connection or other technology. > > Thanks in advance for your support, > > Hovik Avedian > Senior Consultant > Ebase Technology Ltd. > > > !DSPAM:14,44c7a9ac143291148420564! -- Andy Shellam , the Mail Network NetServe Support - we don't go the extra mile; we go the whole distance! p: (+44) 0 845 838 0879 / +44 0 7818 000834 w: www.mailnetwork.co.uk e: support@mailnetwork.co.uk