473,324 Members | 2,567 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

starting psql in windows

Hi there, I am totally new to database programming, and just have a question about starting psql. I've downloaded the latest version of postgresql in windows (xp), and now I need to start using it, except I have no idea where to begin. The documentation at http://www.faqs.org/docs/ppbook/c4890.htm under "starting psql" doesn't seem to be for windows, so I would really really appreciate it if someone could tell me how to start psql in windows.
Thank you.

MA
Jul 18 '07 #1
4 16114
I should add that I intend to have the databases on this machine, and run queries (and eventually use jdbc) on the same machine.
What I have now is postgresql showing up in my start menu, with these options: configuration files, command prompt, documentation, pgAdminIII, psql to 'postgres', reload configuration, start service, and stop service.
Jul 18 '07 #2
michaelb
534 Expert 512MB
The very short answer is read this manual

You may also want to add some environment variables
(Control Panel -> System -> Advanced -> Environment Variables)
because -
* by default psql assumes your Postgres username from your Windows username.
* then it attempts to login into the database with the same name, which probably does not exist.

Considering that default database name is postgres, and default username is postgres you are unlikely to login unless you provide some command line parameters, "psql -U postgres", for example
To avoid having to do it every time you can simply add env var. PGUSER and/or PGDATABASE to the environment and forget about command line switches.

Optionally you could write a 3-liner batch file (forgotten art and sounds ugly these days), a simple wrapper aroung psql.
Jul 19 '07 #3
Hi again, thank you so much for replying. I will read that part of the documentation tomorrow, but off the top of your head, do you know what those variables (PGUSER, PGDATABASE,..) should be set to? Is it the bin directory for PostgreSQL?
Thanks
Jul 19 '07 #4
michaelb
534 Expert 512MB
PGUSER defines the username under which you are logging in.
So instead of using your Windows username the login is performed using name postgres, if this is what PGUSER is set to.

PGDATABASE defines the name of the database where you're logging in.
If you are going to use the database named postgres, created when you install the server, you don't have to set this variable, because by default psql will try to login into the database with the same name as your username.
Jul 19 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Jesse | last post by:
Hi, Can anyone suggest how to go about running a windows application from outside the starting form. ie. making a call to the initial form and then showing it. I have tried this using a...
4
by: Kristof Despiere | last post by:
Suppose you have one domain, filled with a couple of users. What needs to be done now is I need to start a windows application from a webform by pressing a button on the webform (for example). ...
3
by: Johnny Fugazzi | last post by:
OK, I created my handy little windows service and created an MSI installer using the Deployment tool in VS.net with Custom Actions according to the msdn help. Worked great, with one little...
1
by: SQLScott | last post by:
Searched the forum for an answer to this particular question and did not find an answer to i am posting. I have created a Windows Service in VB.Net. I can successfully install and start the...
7
by: Ahmed Perlom | last post by:
Hi all, I am trying to start a windows application that has a GUI from a Windows service written in .NET 2.0. I have been searching on this for few days now with no avail. When using the...
7
by: Joseph Geretz | last post by:
I have a Service which runs OK, but I'm abviously not starting it properly. In my OnStart event I commence a long running process which polls a database table and performs various processing. Since...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.