Обсуждение: PSQL under Windows XP

Поиск
Список
Период
Сортировка

PSQL under Windows XP

От
Danny Gaethofs
Дата:
dear all,

I have a question about creating a database.
I can create a database easily using pgAdminiii, but I
am trying to get it done using psql.

When I try to start the psql editor using psql
I get the message psql: FATAL: Password authentication
failed for user ....

I think I need to login as the administrator. I looked
at the psql to template1 command which is working. I
found the following command:
psql.exe  -h localhost -p 5432 template1 "postgres"

Now I would like to use it but not with template1.

How can I login the psql interactive terminal as the
administrator. It works with the above command for
template1.

What am I missing here?

regards,
Danny



__________________________________
Do you Yahoo!?
Yahoo! Small Business - Try our new Resources site
http://smallbusiness.yahoo.com/resources/

Re: PSQL under Windows XP

От
"Kevin Crenshaw"
Дата:
Danny,

What works for me is to log in as 'postgres' on the template1 database.
From there you can use the 'create database' command to create a new
database.  When that's done, quit template1 and then log in to the new
database as 'postgres'.

HTH,


kevin crenshaw


-----Original Message-----
From: Danny Gaethofs [mailto:dgaethofs@yahoo.com]
Sent: Monday, May 30, 2005 5:51 AM
To: pgsql-novice@postgresql.org
Subject: [NOVICE] PSQL under Windows XP

dear all,

I have a question about creating a database.
I can create a database easily using pgAdminiii, but I
am trying to get it done using psql.

When I try to start the psql editor using psql
I get the message psql: FATAL: Password authentication
failed for user ....

I think I need to login as the administrator. I looked
at the psql to template1 command which is working. I
found the following command:
psql.exe  -h localhost -p 5432 template1 "postgres"

Now I would like to use it but not with template1.

How can I login the psql interactive terminal as the
administrator. It works with the above command for
template1.

What am I missing here?

regards,
Danny



__________________________________
Do you Yahoo!?
Yahoo! Small Business - Try our new Resources site
http://smallbusiness.yahoo.com/resources/

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings


Re: PSQL under Windows XP

От
John DeSoi
Дата:
On May 30, 2005, at 9:52 AM, Kevin Crenshaw wrote:

> What works for me is to log in as 'postgres' on the template1 database.
> From there you can use the 'create database' command to create a new
> database.  When that's done, quit template1 and then log in to the new
> database as 'postgres'.

Additionally, there is a createdb.exe command line utility specifically
designed for this purpose (it should be in the same folder as psql). It
is a little cleaner for this task since you do not have to specify an
existing database to connect to.

http://www.postgresql.org/docs/8.0/interactive/app-createdb.html


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


Re: PSQL under Windows XP

От
Danny Gaethofs
Дата:
Thanks John,

I found this utility but I am having problems getting
it to work properly. I posted a message to the general
group about my problem.

I understand now that there are command line utilities
in the bin directory to perform some functions.

You say you log on as the postgres user on the
template1 database.

The template1 database, is it actually a database
which I should see when using PGADMINIII, cause at
current I do not see it.

Let me say when I use PGADMINIII I am able to create a
database and specify whom is the owner.

But what I wanted to know is whether I can specify the
directory where my new database should appear.
I noticed that using createdb it is possible to
specify the location. Using PGADMINiii I do not see
the possibility.

Am I correct?

regards,
Danny

--- John DeSoi <desoi@pgedit.com> wrote:
>
> On May 30, 2005, at 9:52 AM, Kevin Crenshaw wrote:
>
> > What works for me is to log in as 'postgres' on
> the template1 database.
> > From there you can use the 'create database'
> command to create a new
> > database.  When that's done, quit template1 and
> then log in to the new
> > database as 'postgres'.
>
> Additionally, there is a createdb.exe command line
> utility specifically
> designed for this purpose (it should be in the same
> folder as psql). It
> is a little cleaner for this task since you do not
> have to specify an
> existing database to connect to.
>
>
http://www.postgresql.org/docs/8.0/interactive/app-createdb.html
>
>
> John DeSoi, Ph.D.
> http://pgedit.com/
> Power Tools for PostgreSQL
>
>



__________________________________
Yahoo! Mail Mobile
Take Yahoo! Mail with you! Check email on your mobile phone.
http://mobile.yahoo.com/learn/mail

Re: PSQL under Windows XP

От
John DeSoi
Дата:
On May 30, 2005, at 10:20 AM, Danny Gaethofs wrote:

> I found this utility but I am having problems getting
> it to work properly. I posted a message to the general
> group about my problem.

See my response there.

>
> I understand now that there are command line utilities
> in the bin directory to perform some functions.
>
> You say you log on as the postgres user on the
> template1 database.
>
> The template1 database, is it actually a database
> which I should see when using PGADMINIII, cause at
> current I do not see it.
>
> Let me say when I use PGADMINIII I am able to create a
> database and specify whom is the owner.
>

pgAdmin might hide them by default since they are generally only used
for creating databases. See

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

> But what I wanted to know is whether I can specify the
> directory where my new database should appear.
> I noticed that using createdb it is possible to
> specify the location. Using PGADMINiii I do not see
> the possibility.
>
> Am I correct?
>

I don't see an option with createdb for directory. Do you mean
tablespace?



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


Re: PSQL under Windows XP

От
Danny Gaethofs
Дата:
John,

PGADMINIII is not showing the template and template1
database but while browsing my directories I found in
the data\base directory two subdirectories 1 and
17229. Each time I create a new database a
subdirectory is added. So I assume these first two are
the template and template1 database directories.

Can I have directories for new databases created
elsewhere on my system.

Regards,
Danny
--- John DeSoi <desoi@pgedit.com> wrote:
>
> On May 30, 2005, at 10:20 AM, Danny Gaethofs wrote:
>
> > I found this utility but I am having problems
> getting
> > it to work properly. I posted a message to the
> general
> > group about my problem.
>
> See my response there.
>
> >
> > I understand now that there are command line
> utilities
> > in the bin directory to perform some functions.
> >
> > You say you log on as the postgres user on the
> > template1 database.
> >
> > The template1 database, is it actually a database
> > which I should see when using PGADMINIII, cause at
> > current I do not see it.
> >
> > Let me say when I use PGADMINIII I am able to
> create a
> > database and specify whom is the owner.
> >
>
> pgAdmin might hide them by default since they are
> generally only used
> for creating databases. See
>
>
http://www.postgresql.org/docs/8.0/interactive/manage-ag-
>
> templatedbs.html
>
> > But what I wanted to know is whether I can specify
> the
> > directory where my new database should appear.
> > I noticed that using createdb it is possible to
> > specify the location. Using PGADMINiii I do not
> see
> > the possibility.
> >
> > Am I correct?
> >
>
> I don't see an option with createdb for directory.
> Do you mean
> tablespace?
>
>
>
> John DeSoi, Ph.D.
> http://pgedit.com/
> Power Tools for PostgreSQL
>
>

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Re: PSQL under Windows XP

От
John DeSoi
Дата:
On May 30, 2005, at 12:26 PM, Danny Gaethofs wrote:

> Can I have directories for new databases created
> elsewhere on my system.

See the CREATE TABLESPACE command. This is the only way to have an
individual database created in a different directory from the others in
the main cluster directory.

http://www.postgresql.org/docs/current/interactive/sql-
createtablespace.html


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