running a script from a command line

From: Joe L <superist_joe(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: running a script from a command line
Date: 2007-07-25 18:52:22
Message-ID: 263305.99741.qm@web38714.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I want to use postgres as part of my application. I need to create a database and initialize it and fill it with data as part of the installation process. There is information that is expected to be there.

Now when I try to use psql from a batch script it always prompts for a password. I would like for the installation process to not require any interaction.

Is there a way to create a database and add tables to it that doesn't require the password prompt? I didn't see a command line parameter that allowed you to just enter a password in the command line.

The application is in Java, so I was thinking about using JDBC to create the database and then to create the tables. Is it possible to create a database/tables with JDBC? I'm not too familiar with it, I've been using Hibernate for the database transactions.

The best option is using the script, as I already have one that works.

Thanks,
Joe


____________________________________________________________________________________
Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games.
http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2007-07-25 19:15:53 Re: running a script from a command line
Previous Message Stephen Ince 2007-07-25 17:44:27 silent install of postgres for an embedded purposes