Thanks Szemir.

I failed to mention the init script for postgres (at least the version I have 
right now), handles the initdb step if the database defined in the 
environment variable doesn't exist.  

The problem doesn't seem to be the pg_hba.conf file.  Rather it seems to be 
that postgres is starting without TCP/IP support.  This is normally turned on 
in a config file somewhere (in Gentoo, it's /etc/conf.d/postgresql , and you 
set a '-i' in the PGOPTS variable).  The corresponding config setting 
"should" be in Fedora somewhere, but the files referenced in the init script 
that set PGOPTS (or so I'm assuming that's where it gets set) don't exist.  
So, apparently yum didn't do a full installation? (didn't report any errors 
though).

I can "MAKE" this work, but I don't want to introduce a hack when there is a 
"Fedora way" to fix this that I may not know about.  Anybody running 
PostgreSQL on Fedora?

What I'm trying is this command:

createdb -U master -h localhost webdata

(master is a user I created while su'd to the posgres user).  This results in 
the following:

createdb: could not connect to database template1: could not connect to 
server:
        Is the server running on host "localhost" and accepting
        TCP/IP connections on port 5432?

If I remove the "-h localhost" command, I get the typical IDENT authentication 
failed error, but that still stems from the lack of TCP/IP support (I hope).

Seeing as I just finished starting the server (/etc/init.d/postrgresql start) 
and it started without errors, I know it IS running on the localhost.  But, I 
have not yet turned on the TCP/IP connections, because the config file in 
question doesn't exist.  And rather than creating my own version of the file, 
I'd rather use the "official" Fedora version.  (only because I'm not going to 
be managing this server in the long run, and want to avoid later support 
calls for a hack....)

Thanks for the tips though.

Shawn.

ps.  my apologies if the above sounds a little testy - it's 3:30am, and my 
brain is starting to shut down...

On Saturday 26 February 2005 03:11, bogi wrote:
> Hi Shawn.
>
> Here are some answers ...
>
>
> Creating a Database Cluster
>
> Before you can do anything, you must initialize a database storage area on
> disk.
> We call this a database cluster. (SQL uses the term catalog cluster
> instead.) A database cluster is a collection of databases is accessible by
> a single instance of a running database server. After initialization, a
> database cluster
> will contain a database named template1. As the name suggests, this will be
> used
> as a template for subsequently created databases; it should not be used for
> actual work.
>
>
>
> In file system terms, a database cluster will be a single directory under
> which
> all data will be stored. We call this the data directory or data area. It
> is completely
> up to you where you choose to store your data. There is no default,
> although locations
> such as /usr/local/pgsql/data or /var/lib/pgsql/data are popular. To
> initialize a database
> cluster, use the command initdb, which is installed with PostgreSQL. The
> desired file system
> location of your database system is indicated by the -D option, for example
>
> $ initdb -D /usr/local/pgsql/data
>
> Note that you must execute this command while logged into the PostgreSQL
> user account,
> which is described in the previous section.
>
> Tip: As an alternative to the -D option, you can set the environment
> variable PGDATA.
>
> initdb will attempt to create the directory you specify if it does not
> already exist.
> It is likely that it will not have the permission to do so (if you followed
> our advice
> and created an unprivileged account). In that case you should create the
> directory
> yourself (as root) and change the owner to be the PostgreSQL user. Here is
> how this might be done:
>
> root# mkdir /usr/local/pgsql/data
> root# chown postgres /usr/local/pgsql/data
> root# su postgres
> postgres$ initdb -D /usr/local/pgsql/data
>
>
>
> and from another part
>     PostgreSQL
>     ==========
>
> To allow a bit more access to our server:
>
> /var/lib/pgsql/data/pg_hba.conf
>
> # local    DATABASE  USER  METHOD  [OPTION]
> # host     DATABASE  USER  IP-ADDRESS  IP-MASK  METHOD  [OPTION]
> # hostssl  DATABASE  USER  IP-ADDRESS  IP-MASK  METHOD  [OPTION]
>
> # TYPE  DATABASE    USER        IP-ADDRESS        IP-MASK           METHOD
>
> local   all         all                                             trust
> #host    all         all         127.0.0.1         255.255.255.255   trust
> host     all         all         127.0.0.1         255.255.255.255   trust
> # Using sockets credentials for improved security. Not available
> everywhere, # but works on Linux, *BSD (and probably some others)
>
> #local  all     all     ident   sameuser
> local   all     all     trust   sameuser
>
>
>
> This is some of the class material i teach at the u of c on open source
> databases ...
> Hope it answers your questions.
> Cheers
> Szemir
>
>
>
>
> _______________________________________________
> clug-talk mailing list
> [email protected]
> http://clug.ca/mailman/listinfo/clug-talk_clug.ca
> Mailing List Guidelines (http://clug.ca/ml_guidelines.php)
> **Please remove these lines when replying

_______________________________________________
clug-talk mailing list
[email protected]
http://clug.ca/mailman/listinfo/clug-talk_clug.ca
Mailing List Guidelines (http://clug.ca/ml_guidelines.php)
**Please remove these lines when replying

Reply via email to