473,748 Members | 2,578 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

starting psql in windows

3 New Member
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 16152
markalexander
3 New Member
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 Recognized Expert Contributor
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
markalexander
3 New Member
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 Recognized Expert Contributor
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
1276
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 separate class file with static void Main() { MainForm mf = new MainForm(); mf.Show(); }
4
2423
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). The problem is that the user who "owns" the service is always the ASPNET account. That's not good since you don't see the actual application (because it's owned by ASPNET). I've tried changed the processmodel section in the machine.config file to...
3
1694
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 hitch. The Service is installed and marked for Automatic startup, but the service is not starting with windows. If i reboot and then check the services, the service shows as Stopped, but still marked Automatic. Any idea?
1
1385
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 service on a Windows 2000 Server box but cannot on a windows 2003 box. The error I receive is the following: Server 'ServiceName' failed to start. Verify that you have sufficient privileges to start system Services.
7
2415
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 System.Diagnostic.Process object to start the application (i.e Notepad), the new app runs and it is listed on the task manger list, but the GUI doesn't show up in the desktop of the current user. I am aware windows service (either LocalSystem,...
7
1767
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 this polling loop is entered synchronously from OnStart, basically the OnStart event doesn't terminate for the life of the program. This doesn't give the SCM the correct feedback that the service has started properly. Consequently, the SCM throws...
0
8996
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8832
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9562
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9254
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6799
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3319
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2217
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.