473,465 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

getting started with v 7.4

1 New Member
Hello,

I'm brand new to postgreSQL (I'm running v 7.4) and am working on porting a simple mySQL db to postgres, but I'm a unique (uniquely obnoxious) situation:

I'm not the one who installed postgresSQL on the server I'm working on, but the only way its been used in the past is via some GUI tool that does the heavy lifting for specific GIS applications. I, however, need to get right into the command-line application and create two simple applications, and then configure postgres to allow JDBC to manipulate my databases.

The person who installed postgres is long gone, and no one working here now has used it before without the GIS crutch I mentioned above...that's where you all come in.

I do have admin access on the server postgres is installed on. I tried running the command 'psql' only to recieve the following error:

Expand|Select|Wrap|Line Numbers
  1. no pg_hba.conf entry for host "[local]", user "root", database "root", SSL off
I managed to locate my pg_hba.conf file, the current contents of which are:

Expand|Select|Wrap|Line Numbers
  1. local all postgres ident sameuser
  2. host all all 127.0.0.1/32 md5
  3. host root root local
  4.  
The first three lines were there when I first opened the file and the last line was a feeble attempt on my part to fill in the missing entry the above error is complaining about.

My primary questions are:
-How can I modify my configuration appropriately and run postgreSQL from the command-line so I can create my databases?
-What is the correct syntax for running postgreSQL from the command-line?
-Is there any reason I would want to create a new user for me to use (rather than using 'root')? If so, how do I go about doing that?

Thank you very much in advance for your time and effort.
Dec 11 '07 #1
1 2527
rski
700 Recognized Expert Contributor
Hello,

I'm brand new to postgreSQL (I'm running v 7.4) and am working on porting a simple mySQL db to postgres, but I'm a unique (uniquely obnoxious) situation:

I'm not the one who installed postgresSQL on the server I'm working on, but the only way its been used in the past is via some GUI tool that does the heavy lifting for specific GIS applications. I, however, need to get right into the command-line application and create two simple applications, and then configure postgres to allow JDBC to manipulate my databases.

The person who installed postgres is long gone, and no one working here now has used it before without the GIS crutch I mentioned above...that's where you all come in.

I do have admin access on the server postgres is installed on. I tried running the command 'psql' only to recieve the following error:

Expand|Select|Wrap|Line Numbers
  1. no pg_hba.conf entry for host "[local]", user "root", database "root", SSL off
I managed to locate my pg_hba.conf file, the current contents of which are:

Expand|Select|Wrap|Line Numbers
  1. local all postgres ident sameuser
  2. host all all 127.0.0.1/32 md5
  3. host root root local
  4.  
The first three lines were there when I first opened the file and the last line was a feeble attempt on my part to fill in the missing entry the above error is complaining about.

My primary questions are:
-How can I modify my configuration appropriately and run postgreSQL from the command-line so I can create my databases?
-What is the correct syntax for running postgreSQL from the command-line?
-Is there any reason I would want to create a new user for me to use (rather than using 'root')? If so, how do I go about doing that?

Thank you very much in advance for your time and effort.
ad 1.
change the first line in pg_hba.conf to
local all all trust (isn't very safe but you will be able do connect with server with any database login
There is an error in the 3-rd line (in host connections you must give na IP and mask).
By the way, it would be better, you look at postgres.org and see what the column in pg_hba.conf means

ad 2.
starting the server: pg_ctl start (if variable PGDATA is set)
connecting with server psql database_name

ad 3.
The database superuser is called postgres. Root isn't even a user of database, uless postgres change it. It's like with OS, be better to create ordinary user and work on his account.
(sorry for my poor english)
Dec 12 '07 #2

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

Similar topics

5
by: Philip Ronan | last post by:
OK, here's my 2p worth: === Q. Why am I getting the error message 'Headers already sent'? A. PHP produces this error message when you try to set a header for a web page after you have already...
1
by: soni29 | last post by:
Hi, I'm going to be starting a project with a friend of mine in C#, we're doing it to learn the language a little better, to get more experience with it. We've already come up with an idea of the...
0
by: cara_little | last post by:
Good Morning, I'm trying to get started with the Enterprise Library to evaluate it and recommend to the rest of the developers in the company. However, I'm having a heck of a time getting started...
0
by: tamdino | last post by:
Please accept my apologies if I am posting this in the wrong place. I am trying to get started using MySQL-Front and I am totally lost. Does anyone know where there is a tutorial for getting...
84
by: Bibby | last post by:
Hi, I'm interested in getting started in the programming world. I've dabbled in C, C++ and VB6. Which would be the best language to focus my attention to regarding the following considerations: ...
6
by: Jack Duijf | last post by:
Hello, I am looking for a person in The Netherlands that is willing to help me getting started with Vb.net. Please send a message to jack@aicn.nl if you can help me getting started with the...
1
by: =?Utf-8?B?Q29kZVNsaW5nZXI=?= | last post by:
I plan to build my own 2008 Server/Hyper-V system and will not be using one of the tested Dell or HP systems from the release notes and could use some pointers as to my assumnptions and answers to...
0
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,...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.