LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-10-2003, 12:47 PM   #1
beyond_2000
Member
 
Registered: Oct 2002
Location: Guangdong,Chinese
Distribution: Redhat AS 3.0 + FC1
Posts: 72

Rep: Reputation: 15
Problem with PostgreSQL !!!


hi, proficients

I encounted a weird problem when i intend to install phpBB2 on my suse 8.2 pro.I selected postgresql as my db . the service is opened and i can operate the db.
but, when i install phpbb2, the critical error occured. which is the error message below:

Warning: pg_connect() [function.pg-connect]: Unable to connect to PostgreSQL server: could not connect to server: Connection refused Is the server running on host lizard and accepting TCP/IP connections on port 5432? . in /srv/www/htdocs/bbs/phpbb2/db/postgres7.php on line 79
phpBB : Critical Error

Could not connect to the database

the port 5432 is allowed by firewall and also allowed local access by hosts.allow.

what is the matter ?

thanks a lot!
 
Old 06-10-2003, 03:30 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Check postgresql.conf,
see if
tcpip_socket = true
is set.

Check pg_hba.conf,
make sure the host you're trying to connect
from is listed (or allowed by some generic
pattern :}) ...

Cheers,
Tink
 
Old 06-11-2003, 12:32 AM   #3
beyond_2000
Member
 
Registered: Oct 2002
Location: Guangdong,Chinese
Distribution: Redhat AS 3.0 + FC1
Posts: 72

Original Poster
Rep: Reputation: 15
so ,where i should put the postgresql.conf in ? /etc or /usr/share/pgsql ? and , i never found pg_hba.conf, maybe suse is different between other distro.
would you like give me more details?
thanks in advance
 
Old 06-11-2003, 01:33 AM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Ummm ... try
locate <filename>
with both of them.

I doubt pg would run without them.

Cheers,
Tink
 
Old 06-11-2003, 02:44 AM   #5
beyond_2000
Member
 
Registered: Oct 2002
Location: Guangdong,Chinese
Distribution: Redhat AS 3.0 + FC1
Posts: 72

Original Poster
Rep: Reputation: 15
i found postgresql.conf and cp it to /etc , set
tcpip_socket = true
port = 5432
show_source_port = true

no other changing.
this is the postgresql.conf contant below:
---------------------------------------------------------------
#
# PostgreSQL configuration file
# -----------------------------
#
# This file consists of lines of the form:
#
# name = value
#
# (The '=' is optional.) White space may be used. Comments are introduced
# with '#' anywhere on a line. The complete list of option names and
# allowed values can be found in the PostgreSQL documentation. The
# commented-out settings shown in this file represent the default values.
#
# Any option can also be given as a command line switch to the
# postmaster, e.g. 'postmaster -c log_connections=on'. Some options
# can be changed at run-time with the 'SET' SQL command.
#
# This file is read on postmaster startup and when the postmaster
# receives a SIGHUP. If you edit the file on a running system, you have
# to SIGHUP the postmaster for the changes to take effect, or use
# "pg_ctl reload".


#========================================================================


#
# Connection Parameters
#
tcpip_socket = true
#ssl = false

#max_connections = 32
#superuser_reserved_connections = 2

port = 5432
#hostname_lookup = false
show_source_port = true

#unix_socket_directory = ''
#unix_socket_group = ''
#unix_socket_permissions = 0777 # octal

#virtual_host = ''

#krb_server_keyfile = ''


#
# Shared Memory Size
#
#shared_buffers = 64 # min max_connections*2 or 16, 8KB each
#max_fsm_relations = 1000 # min 10, fsm is free space map, ~40 bytes
#max_fsm_pages = 10000 # min 1000, fsm is free space map, ~6 bytes
#max_locks_per_transaction = 64 # min 10
#wal_buffers = 8 # min 4, typically 8KB each

#
# Non-shared Memory Sizes
#
#sort_mem = 1024 # min 64, size in KB
#vacuum_mem = 8192 # min 1024, size in KB


#
# Write-ahead log (WAL)
#
#checkpoint_segments = 3 # in logfile segments, min 1, 16MB each
#checkpoint_timeout = 300 # range 30-3600, in seconds
#
#commit_delay = 0 # range 0-100000, in microseconds
#commit_siblings = 5 # range 1-1000
#
#fsync = true
#wal_sync_method = fsync # the default varies across platforms:
# # fsync, fdatasync, open_sync, or open_datasync
#wal_debug = 0 # range 0-16


#
# Optimizer Parameters
#
#enable_seqscan = true
#enable_indexscan = true
#enable_tidscan = true
#enable_sort = true
#enable_nestloop = true
#enable_mergejoin = true
#enable_hashjoin = true

#effective_cache_size = 1000 # typically 8KB each
#random_page_cost = 4 # units are one sequential page fetch cost
#cpu_tuple_cost = 0.01 # (same)
#cpu_index_tuple_cost = 0.001 # (same)
#cpu_operator_cost = 0.0025 # (same)

#default_statistics_target = 10 # range 1-1000

#
# GEQO Optimizer Parameters
#
#geqo = true
#geqo_selection_bias = 2.0 # range 1.5-2.0
#geqo_threshold = 11
#geqo_pool_size = 0 # default based on tables in statement,
# range 128-1024
#geqo_effort = 1
#geqo_generations = 0
#geqo_random_seed = -1 # auto-compute seed


#
# Message display
#
#server_min_messages = notice # Values, in order of decreasing detail:
# debug5, debug4, debug3, debug2, debug1,
# info, notice, warning, error, log, fatal,
# panic
#client_min_messages = notice # Values, in order of decreasing detail:
# debug5, debug4, debug3, debug2, debug1,
# log, info, notice, warning, error
#silent_mode = false

#log_connections = false
#log_pid = false
#log_statement = false
#log_duration = false
#log_timestamp = false

#log_min_error_statement = error # Values in order of increasing severity:
# debug5, debug4, debug3, debug2, debug1,
# info, notice, warning, error, panic(off)

#debug_print_parse = false
#debug_print_rewritten = false
#debug_print_plan = false
#debug_pretty_print = false

#explain_pretty_print = true

# requires USE_ASSERT_CHECKING
#debug_assertions = true


#
# Syslog
#
#syslog = 0 # range 0-2
#syslog_facility = 'LOCAL0'
#syslog_ident = 'postgres'


#
# Statistics
#
#show_parser_stats = false
#show_planner_stats = false
#show_executor_stats = false
#show_statement_stats = false

# requires BTREE_BUILD_STATS
#show_btree_build_stats = false


#
# Access statistics collection
#
#stats_start_collector = true
#stats_reset_on_server_start = true
#stats_command_string = false
#stats_row_level = false
#stats_block_level = false


#
# Lock Tracing
#
#trace_notify = false

# requires LOCK_DEBUG
#trace_locks = false
#trace_userlocks = false
#trace_lwlocks = false
#debug_deadlocks = false
#trace_lock_oidmin = 16384
#trace_lock_table = 0


#
# Misc
#
#autocommit = true
#dynamic_library_path = '$libdir'
#search_path = '$user,public'
#datestyle = 'iso, us'
#timezone = unknown # actually, defaults to TZ environment setting
#australian_timezones = false
#client_encoding = sql_ascii # actually, defaults to database encoding
#authentication_timeout = 60 # 1-600, in seconds
#deadlock_timeout = 1000 # in milliseconds
#default_transaction_isolation = 'read committed'
#max_expr_depth = 10000 # min 10
#max_files_per_process = 1000 # min 25
password_encryption = true
#sql_inheritance = true
#transform_null_equals = false
#statement_timeout = 0 # 0 is disabled, in milliseconds
#db_user_namespace = false

------------------------------------------------------------
and i restart suse, reinstall phpbb2, the same error message prompt to me. what shall i do?
 
Old 06-11-2003, 06:17 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
I have no clue what SuSE has done to
their PostgreSQL rpm(s) ... I'd suggest
uninstalling it, and grab the source-tarball,
and make a "do-it-yourself" installation.

http://www.postgresql.org

Cheers,
Tink
 
Old 06-11-2003, 07:45 PM   #7
aherm
Member
 
Registered: Jan 2003
Location: upNorth
Distribution: openSuSE/uBuntu
Posts: 410

Rep: Reputation: 30
You need additional rpms below:
postgresql-server
postgresql-test


Have fun :-)
 
Old 08-14-2003, 10:03 AM   #8
jdruin
Member
 
Registered: Jul 2003
Location: Louisville aka Derby City
Distribution: WinXP SP2 and SP3, W2K Server, Ubuntu
Posts: 313

Rep: Reputation: 30
That is the correct setup for your postgresql.conf file. You can locate the pg_hba.conf by

find \ -name pg_hba.conf

Try going into that file and scroll to the bottom. Setup your network connection to be trusted for now until you get this working like so:

local all all trust
host all all 127.0.0.1 255.255.255.255 trust
host all all xxx.xxx.xxx.0 255.255.255.0 trust

where xxx.xxx.xxx.0 is your network.

Then you must restart postgres with the "-i" flag to get it to accept incomming TCP\IP. You can do this as such:

pg_ctl -D $PGDATA -o "-i" -l $PGLOG -p $PGPORT

Of course those variables are specific to your system.

In summary:

postgresql.conf needs the tcpip_socket = YES
pg_hba.conf needs to allow the network to connect
postgres must be started to allow TCPIP (-i option)
 
Old 11-10-2003, 05:25 PM   #9
scorpatron
Member
 
Registered: Nov 2003
Location: New Zealand
Distribution: Redhat 9 2.4.20-8 Athlon, Windows 2000 Professional, FreeBSD
Posts: 122

Rep: Reputation: 15
I'm having the same problem, still doesn't work

Is there any way to test if postmaster is actually listening on that port?
 
Old 11-10-2003, 05:51 PM   #10
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
How are yah? :)

Quote:
I'm having the same problem, still doesn't work
Is there any way to test if postmaster is actually listening on that port?
Everything identical?
=>
Mail him, he didn't come back to
ask more questions ;)


Some things different?
=>
Post them.

Cheers,
Tink
 
Old 06-15-2004, 06:46 AM   #11
ratnadeep
LQ Newbie
 
Registered: Jun 2004
Posts: 1

Rep: Reputation: 0
you can check whether postgresql server is listening on the port 5432 using nmap command:
"nmap localhost -p 5432"

hope that helps,
- Ratnadeep
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
postgresql problem eduac Linux - Software 0 08-31-2005 06:45 AM
Postgresql Problem mitrship Programming 3 07-28-2005 12:09 AM
PostgreSQL Problem r0ck Slackware 8 11-26-2004 11:02 AM
Postgresql problem BobNz Linux - Software 11 05-02-2004 02:43 PM
postgresql -odbc & postgresql-jdbc installation kjsubbu Linux - Software 0 06-19-2003 02:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration