Thread: using pgsql on my comp only without tcp

using pgsql on my comp only without tcp

From
stm23
Date:
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


Re: using pgsql on my comp only without tcp

From
Bruno Wolff III
Date:
On Wed, Mar 10, 2004 at 12:47:16 +1300,
  stm23 <STM23@student.canterbury.ac.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.

On Tue, 9 Mar 2004, Bruno Wolff III wrote:
> On Wed, Mar 10, 2004 at 12:47:16 +1300,
>   stm23 <STM23@student.canterbury.ac.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


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

From
Mohan
Date:
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@freenet.edmonton.ab.ca wrote:

> On Tue, 9 Mar 2004, Bruno Wolff III wrote:
> > On Wed, Mar 10, 2004 at 12:47:16 +1300,
> >   stm23 <STM23@student.canterbury.ac.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