Re: local usage was: Re: using pgsql on my comp only without

Lists: pgsql-novice
From: stm23 <STM23(at)student(dot)canterbury(dot)ac(dot)nz>
To: pgsql-novice(at)postgresql(dot)org
Subject: using pgsql on my comp only without tcp
Date: 2004-03-09 23:47:16
Message-ID: 404CF6BD@webmail
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

hi, i am unable to setup my modem on my redhat 8.0 OS, so i don't think i can
get TCP access. is it possible to use pgsql entirely on my local computer
(i.e creating my own databases & manipulating them on my comp)?. what
variables do i need to alter to do so? i just want to be able to simulate the
labs for my 300 level uni course so i practice using databases. i am also
having difficulty finding my postgresql.conf file. i have my psql &
postmaster files in the following directories:

/usr/bin/psql
/usr/bin/postmaster

but i can't find any pgsql folder grouping pgsql stuff together.

thanx, sam


From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: stm23 <STM23(at)student(dot)canterbury(dot)ac(dot)nz>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: using pgsql on my comp only without tcp
Date: 2004-03-10 05:02:16
Message-ID: 20040310050216.GD31629@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

On Wed, Mar 10, 2004 at 12:47:16 +1300,
stm23 <STM23(at)student(dot)canterbury(dot)ac(dot)nz> wrote:
> hi, i am unable to setup my modem on my redhat 8.0 OS, so i don't think i can
> get TCP access. is it possible to use pgsql entirely on my local computer
> (i.e creating my own databases & manipulating them on my comp)?. what
> variables do i need to alter to do so? i just want to be able to simulate the

You don't need a modem for tcp access on the same machine that is running
postgres. There is a loopback interface that is part of the OS that takes
care of that. You also have (the better) option of using domain sockets
for connecting to the database from the same host.

> labs for my 300 level uni course so i practice using databases. i am also
> having difficulty finding my postgresql.conf file. i have my psql &
> postmaster files in the following directories:
>
> /usr/bin/psql
> /usr/bin/postmaster
>
> but i can't find any pgsql folder grouping pgsql stuff together.

The database cluster directories are typically in /usr/lib/pgsql.
Each cluster will have its own directory. Typically you have one
cluster in the 'data' directory. The per cluster config files
(such as postgres.conf) will be in that directory. I don't know if
Redhat supplies you with a cluster or not. You can create new ones
using the initdb command. You give the location of the new cluster
using the -D option.


From: <ghaverla(at)freenet(dot)edmonton(dot)ab(dot)ca>
To: pgsql-novice(at)postgresql(dot)org
Cc: stm23 <STM23(at)student(dot)canterbury(dot)ac(dot)nz>
Subject: local usage was: Re: using pgsql on my comp only without tcp
Date: 2004-03-10 12:17:26
Message-ID: Pine.A41.3.95.1040310050119.20242C-100000@fn2.freenet.edmonton.ab.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

On Tue, 9 Mar 2004, Bruno Wolff III wrote:
> On Wed, Mar 10, 2004 at 12:47:16 +1300,
> stm23 <STM23(at)student(dot)canterbury(dot)ac(dot)nz> wrote:

>> hi, i am unable to setup my modem on my redhat 8.0 OS, so i
>> don't think i can get TCP access. is it possible to use pgsql
>> entirely on my local computer (i.e creating my own databases &
>> manipulating them on my comp)?
>
> You don't need a modem for tcp access on the same machine that is running
> postgres. There is a loopback interface that is part of the OS that takes
> care of that. You also have (the better) option of using domain sockets
> for connecting to the database from the same host.

Just getting a little more wordy here.

I suppose it is possible to set up Linux such that the "localhost"
doesn't exist, but in general if you have networking installed
this thing called localhost will exist. It is also known as the
loopback interface, and is called 'lo' in some instances
(ifconfig).

A long time ago, people realised that in networking it was always
handy to be able to get to "here". If for no other reason, than
to test network capable software. Most programs happen to know
what $CWD is (Current Working Directory), well localhost is a
similar idea applied to a network. In terms of an IP address,
localhost is 127.0.0.1.

An example is to telnet to 127.0.0.1. This just lets you login to
your own computer, but instead of the computer thinking you are
logged in at the console, you are logged in over a network
connection.

So, to use postgres over a local networking connection, we will
have some program establish a connection to 127.0.0.1 on the port
that the PostgreSQL postmaster is listening to (on my machine,
that's 5432). If I later decided to move my database to a
different machine, or move the program to a different machine, all
I need to do is to change the address (and possibly port number),
I don't need to change how the program operates.

We'll leave sockets and what domain they are in to a different
message. :-)

Hopefully this is a little "better" description, in the case you
didn't understand the more concise explanation offered earlier.

Gord


From: Mohan <mohanyes(at)shafika(dot)vetri(dot)com>
To: ghaverla(at)freenet(dot)edmonton(dot)ab(dot)ca
Cc: pgsql-novice(at)postgresql(dot)org, stm23 <STM23(at)student(dot)canterbury(dot)ac(dot)nz>
Subject: Re: local usage was: Re: using pgsql on my comp only without
Date: 2004-03-10 13:08:40
Message-ID: 404F1358.CD6C00E2@shafika.vetri.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

Thanks for the wonderful explanation.
I installed postgresql in windows 2000, and when i configured to local host, i
got socket error.
I installed apache and configured it then it works fine.
Is that any webserver required to come out of Socket error?
Regards,
mohan

ghaverla(at)freenet(dot)edmonton(dot)ab(dot)ca wrote:

> On Tue, 9 Mar 2004, Bruno Wolff III wrote:
> > On Wed, Mar 10, 2004 at 12:47:16 +1300,
> > stm23 <STM23(at)student(dot)canterbury(dot)ac(dot)nz> wrote:
>
> >> hi, i am unable to setup my modem on my redhat 8.0 OS, so i
> >> don't think i can get TCP access. is it possible to use pgsql
> >> entirely on my local computer (i.e creating my own databases &
> >> manipulating them on my comp)?
> >
> > You don't need a modem for tcp access on the same machine that is running
> > postgres. There is a loopback interface that is part of the OS that takes
> > care of that. You also have (the better) option of using domain sockets
> > for connecting to the database from the same host.
>
> Just getting a little more wordy here.
>
> I suppose it is possible to set up Linux such that the "localhost"
> doesn't exist, but in general if you have networking installed
> this thing called localhost will exist. It is also known as the
> loopback interface, and is called 'lo' in some instances
> (ifconfig).
>
> A long time ago, people realised that in networking it was always
> handy to be able to get to "here". If for no other reason, than
> to test network capable software. Most programs happen to know
> what $CWD is (Current Working Directory), well localhost is a
> similar idea applied to a network. In terms of an IP address,
> localhost is 127.0.0.1.
>
> An example is to telnet to 127.0.0.1. This just lets you login to
> your own computer, but instead of the computer thinking you are
> logged in at the console, you are logged in over a network
> connection.
>
> So, to use postgres over a local networking connection, we will
> have some program establish a connection to 127.0.0.1 on the port
> that the PostgreSQL postmaster is listening to (on my machine,
> that's 5432). If I later decided to move my database to a
> different machine, or move the program to a different machine, all
> I need to do is to change the address (and possibly port number),
> I don't need to change how the program operates.
>
> We'll leave sockets and what domain they are in to a different
> message. :-)
>
> Hopefully this is a little "better" description, in the case you
> didn't understand the more concise explanation offered earlier.
>
> Gord
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster