Thread: Problem wth postgresql.conf

Problem wth postgresql.conf

From
"Григорий Никоноров"
Date:
Hello all! 

Can anyone help me with following error: I raised max_connections from 100 to 256 and try to restart server but have next error: 

FATAL:  syntax error in file "/opt/PostgreSQL/8.3/data/postgresql.conf" line 108, near token "MB"
How can i fix it ?

Postgresql.conf file:
#------------------------------------------------------------------------------
# CONNECTIONS AND AUTHENTICATION
#------------------------------------------------------------------------------

# - Connection Settings -

listen_addresses = '*'
#listen_addresses = 'localhost'         # what IP address(es) to listen on;
                                        # comma-separated list of addresses;
                                        # defaults to 'localhost', '*' = all
                                        # (change requires restart)
port = 5432                             # (change requires restart)
max_connections = 256                   # (change requires restart)
# Note:  Increasing max_connections costs ~400 bytes of shared memory per
# connection slot, plus lock space (see max_locks_per_transaction).  You might
# also need to raise shared_buffers to support more connections.
#superuser_reserved_connections = 3     # (change requires restart)
#unix_socket_directory = ''             # (change requires restart)
#unix_socket_group = ''                 # (change requires restart)
#unix_socket_permissions = 0777         # begin with 0 to use octal notation
                                        # (change requires restart)
#bonjour_name = ''                      # defaults to the computer name
                                        # (change requires restart)

# - Security and Authentication -

#authentication_timeout = 1min          # 1s-600s
#ssl = off                              # (change requires restart)
#ssl_ciphers = 'ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH'      # allowed SSL ciphers
                                        # (change requires restart)
#password_encryption = on
#db_user_namespace = off

# Kerberos and GSSAPI
#krb_server_keyfile = ''                # (change requires restart)
#krb_srvname = 'postgres'               # (change requires restart, Kerberos only)
#krb_server_hostname = ''               # empty string matches any keytab entry
                                        # (change requires restart, Kerberos only)
#krb_caseins_users = off                # (change requires restart)
#krb_realm = ''                         # (change requires restart)

# - TCP Keepalives -
# see "man 7 tcp" for details

#tcp_keepalives_idle = 0                # TCP_KEEPIDLE, in seconds;
                                        # 0 selects the system default
#tcp_keepalives_interval = 0            # TCP_KEEPINTVL, in seconds;
                                        # 0 selects the system default
#tcp_keepalives_count = 0               # TCP_KEEPCNT;
                                        # 0 selects the system default


#------------------------------------------------------------------------------
# RESOURCE USAGE (except WAL)
#------------------------------------------------------------------------------

# - Memory -

shared_buffers = 128MB                  # min 128kB or max_connections*16kB     !!!!!!!!!!!!!!!!!!!
                                        # (change requires restart)
#temp_buffers = 8MB                     # min 800kB
#max_prepared_transactions = 5          # can be 0 or more
                                        # (change requires restart)
# Note:  Increasing max_prepared_transactions costs ~600 bytes of shared memory
# per transaction slot, plus lock space (see max_locks_per_transaction).
#work_mem = 1MB                         # min 64kB
#maintenance_work_mem = 16MB            # min 1MB
#max_stack_depth = 2MB                  # min 100kB

# - Free Space Map -

max_fsm_pages = 204800                  # min max_fsm_relations*16, 6 bytes each
                                        # (change requires restart)
#max_fsm_relations = 1000               # min 100, ~70 bytes each
                                        # (change requires restart)

Thanks in advance!                                                                                 
-- 
С уважением,
Никоноров Григорий

Re: Problem wth postgresql.conf

From
Tom Lane
Date:
"=?KOI8-R?B?59LJx8/Sycog7snLz87P0s/X?=" <grigory.nikonorov@gmail.com> writes:
> FATAL:  syntax error in file "/opt/PostgreSQL/8.3/data/postgresql.conf" line
> 108, near token "MB"
> How can i fix it ?

> shared_buffers = 128MB                  # min 128kB or max_connections*16kB

I think you need quotes here:

shared_buffers = '128MB'

            regards, tom lane

Re: Problem wth postgresql.conf

From
Brad Nicholson
Date:
On Fri, 2008-09-05 at 11:28 -0400, Tom Lane wrote:
> "=?KOI8-R?B?59LJx8/Sycog7snLz87P0s/X?=" <grigory.nikonorov@gmail.com> writes:
> > FATAL:  syntax error in file "/opt/PostgreSQL/8.3/data/postgresql.conf" line
> > 108, near token "MB"
> > How can i fix it ?
>
> > shared_buffers = 128MB                  # min 128kB or max_connections*16kB
>
> I think you need quotes here:
>
> shared_buffers = '128MB'
>

Pretty sure you don't need quotes (checking a running 8.3 instance -
nope, no quotes).

I'll bet you are using an older version of PG binaries to try and start
the databases.  Postgres did not recognize units like MB prior to 8.2.
If you try and start an 8.3 cluster with an older binary, it will throw
this error (I did this by mistake on a test cluster last week, I
recognize the error).

Make sure that you are using the PG 8.3 binaries.  Run

pg_ctl --version

If that's not 8.3.x, that's your problem.
--
Brad Nicholson  416-673-4106
Database Administrator, Afilias Canada Corp.


Re: Problem wth postgresql.conf

From
"Григорий Никоноров"
Date:
Thanks Brad! 

When i start pg_ctl from postgresql v 8.3 i have this error but how i think pg_ctl used postgresql.conf from v. 8.1.4. Next thing - completely delete Postgresql v. 8.1.4 from server. Now all fine :)

Thank you all!

2008/9/9 Brad Nicholson <bnichols@ca.afilias.info>
On Fri, 2008-09-05 at 11:28 -0400, Tom Lane wrote:
> "Григорий Никоноров" <grigory.nikonorov@gmail.com> writes:
> > FATAL:  syntax error in file "/opt/PostgreSQL/8.3/data/postgresql.conf" line
> > 108, near token "MB"
> > How can i fix it ?
>
> > shared_buffers = 128MB                  # min 128kB or max_connections*16kB
>
> I think you need quotes here:
>
> shared_buffers = '128MB'
>

Pretty sure you don't need quotes (checking a running 8.3 instance -
nope, no quotes).

I'll bet you are using an older version of PG binaries to try and start
the databases.  Postgres did not recognize units like MB prior to 8.2.
If you try and start an 8.3 cluster with an older binary, it will throw
this error (I did this by mistake on a test cluster last week, I
recognize the error).

Make sure that you are using the PG 8.3 binaries.  Run

pg_ctl --version

If that's not 8.3.x, that's your problem.
--
Brad Nicholson  416-673-4106
Database Administrator, Afilias Canada Corp.




--
С уважением,
Никоноров Григорий