Thread: Windows XP PostgreSQL usage

Windows XP PostgreSQL usage

From
Danny Gaethofs
Date:
Dear all,

I installed PostgreSQL on my windows xp and on my
windows 2000 system using the postgresql-9.0.msi.

I completed the installation procedure and now I want
to start creating a database.

I have a few questions:
1. during installation I cannot change the directory
where the database should be created. Is there a way
to have the postgresql database stored on another
partition of my hard disk.

2. do i still have to run initdb after installation
using the msi installer

3. I want to create a database which of the tools can
I use:

I noticed pgadminiii provides functionality for
creating a database.

I could also open a command window using runas
/noprofile /user:postgres cmd and try to create a
database there.

4. Can I use a template ? I noticed there is a command
psql to template1, but I read somewhere the template1
is used as the basis for new ... databases or tables
being created. What can I do with templates?

regards,
Danny



__________________________________
Do you Yahoo!?
Make Yahoo! your home page
http://www.yahoo.com/r/hs

Re: Windows XP PostgreSQL usage

From
John DeSoi
Date:
On Apr 18, 2005, at 8:53 AM, Danny Gaethofs wrote:

> I have a few questions:
> 1. during installation I cannot change the directory
> where the database should be created. Is there a way
> to have the postgresql database stored on another
> partition of my hard disk.

Are you sure you can't change the directory? Looks like there is an
option for it here:

http://pginstaller.projects.postgresql.org/


>
> 2. do i still have to run initdb after installation
> using the msi installer

Only if you don't have the installer setup the data directory.

>
> 3. I want to create a database which of the tools can
> I use:
>
> I noticed pgadminiii provides functionality for
> creating a database.

Yes.

>
> I could also open a command window using runas
> /noprofile /user:postgres cmd and try to create a
> database there.
>

initdb sets up the "cluster" which can have many databases. Once the
cluster is setup (with the installer or initdb), you can create a new
database using the SQL command CREATE DATABASE. You can also use the
createdb command line tool. You don't need to use runas for this. You
just need to authenticate as a database user that has privileges to
create databases.


> 4. Can I use a template ? I noticed there is a command
> psql to template1, but I read somewhere the template1
> is used as the basis for new ... databases or tables
> being created. What can I do with templates?
>


You can modify template1 so that any new database created starts as a
copy of template1.


John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL


Re: Windows XP PostgreSQL usage

From
George Weaver
Date:
>> 4. Can I use a template ? I noticed there is a command
>> psql to template1, but I read somewhere the template1
>> is used as the basis for new ... databases or tables
>> being created. What can I do with templates?
>>
> You can modify template1 so that any new database created starts as a
> copy of template1.

You may also want to check out:

http://www.postgresql.org/docs/8.0/static/manage-ag-templatedbs.html

Regards,
George