Обсуждение: pg_upgrade unrecognized configuration parameter “unix_socket_directory”

Поиск
Список
Период
Сортировка

pg_upgrade unrecognized configuration parameter “unix_socket_directory”

От
Clodoaldo Neto
Дата:
I'm trying to upgrade Postgresql from 9.2 to 9.3 in Fedora 18 using this command as the postgres user

$ pg_upgrade -b /bin -B /usr/pgsql-9.3/bin -d /var/lib/pgsql/data -D /var/lib/pgsql/9.3/data/ -j 2 -u postgres

The error in the log:

command: "/bin/pg_ctl" -w -l "pg_upgrade_server.log" -D "/var/lib/pgsql/data" -o "-p 50432 -b  -c listen_addresses='' -c unix_socket_permissions=0700 -c unix_socket_directory='/var/lib/pgsql'" start >> "pg_upgrade_server.log" 2>&1
waiting for server to start....FATAL:  unrecognized configuration parameter "unix_socket_directory"
.... stopped waiting
pg_ctl: could not start server

That parameter was replaced by unix_socket_directories (plural) in 9.3. But the server version being started is 9.2:

    $ /bin/pg_ctl --version
    pg_ctl (PostgreSQL) 9.2.4


What am I missing?

Regards, Clodoaldo

Re: [GENERAL] pg_upgrade unrecognized configuration parameter “unix_socket_directory”

От
Michael Paquier
Дата:
On Wed, Sep 18, 2013 at 11:35 AM, Clodoaldo Neto
<clodoaldo.pinto.neto@gmail.com> wrote:
> I'm trying to upgrade Postgresql from 9.2 to 9.3 in Fedora 18 using this
> command as the postgres user
>
> $ pg_upgrade -b /bin -B /usr/pgsql-9.3/bin -d /var/lib/pgsql/data -D
> /var/lib/pgsql/9.3/data/ -j 2 -u postgres
>
> The error in the log:
>
> command: "/bin/pg_ctl" -w -l "pg_upgrade_server.log" -D
> "/var/lib/pgsql/data" -o "-p 50432 -b  -c listen_addresses='' -c
> unix_socket_permissions=0700 -c unix_socket_directory='/var/lib/pgsql'"
> start >> "pg_upgrade_server.log" 2>&1
> waiting for server to start....FATAL:  unrecognized configuration parameter
> "unix_socket_directory"
> .... stopped waiting
> pg_ctl: could not start server
>
> That parameter was replaced by unix_socket_directories (plural) in 9.3. But
> the server version being started is 9.2:
>
>     $ /bin/pg_ctl --version
>     pg_ctl (PostgreSQL) 9.2.4
>
> What am I missing?
Are you sure that the version of pg_upgrade you are using is from 9.3
and not 9.2? You should always use pg_upgrade from the new server
version.

By looking at contrib/pg_upgrade/server.c in 9.3 code, the code takes
into account unix_socket_directories that has been renamed in 9.3:
    /* Have a sockdir?  Tell the postmaster. */
    if (cluster->sockdir)
        snprintf(socket_string + strlen(socket_string),
                 sizeof(socket_string) - strlen(socket_string),
                 " -c %s='%s'",
                 (GET_MAJOR_VERSION(cluster->major_version) < 903) ?
                 "unix_socket_directory" : "unix_socket_directories",
                 cluster->sockdir);
So no problem on this side.

Regards,
--
Michael


Re: pg_upgrade unrecognized configuration parameter “unix_socket_directory”

От
Clodoaldo Neto
Дата:
Someone claims to have fixed it patching pg_upgrade:

http://dba.stackexchange.com/a/50714/6978

Quoting:

"My solution is to rebuild the pg_upgrade from sources, with update to file contrib/pg_upgrade/server.c:199 where pg_upgrade checks for server version:

199:       (GET_MAJOR_VERSION(cluster->major_version) < 903) ?

, in my case i change it to:

199:       (GET_MAJOR_VERSION(cluster->major_version) < 900) ?"

Clodoaldo


2013/9/18 Clodoaldo Neto <clodoaldo.pinto.neto@gmail.com>
I'm trying to upgrade Postgresql from 9.2 to 9.3 in Fedora 18 using this command as the postgres user

$ pg_upgrade -b /bin -B /usr/pgsql-9.3/bin -d /var/lib/pgsql/data -D /var/lib/pgsql/9.3/data/ -j 2 -u postgres

The error in the log:

command: "/bin/pg_ctl" -w -l "pg_upgrade_server.log" -D "/var/lib/pgsql/data" -o "-p 50432 -b  -c listen_addresses='' -c unix_socket_permissions=0700 -c unix_socket_directory='/var/lib/pgsql'" start >> "pg_upgrade_server.log" 2>&1
waiting for server to start....FATAL:  unrecognized configuration parameter "unix_socket_directory"
.... stopped waiting
pg_ctl: could not start server

That parameter was replaced by unix_socket_directories (plural) in 9.3. But the server version being started is 9.2:

    $ /bin/pg_ctl --version
    pg_ctl (PostgreSQL) 9.2.4


What am I missing?

Regards, Clodoaldo

Re: Re: pg_upgrade unrecognized configuration parameter “unix_socket_directory”

От
Bruce Momjian
Дата:
On Sun, Sep 29, 2013 at 07:12:43AM -0300, Clodoaldo Neto wrote:
> Someone claims to have fixed it patching pg_upgrade:
>
> http://dba.stackexchange.com/a/50714/6978
>
> Quoting:
>
> "My solution is to rebuild the pg_upgrade from sources, with update to file
> contrib/pg_upgrade/server.c:199 where pg_upgrade checks for server version:
>
> 199:       (GET_MAJOR_VERSION(cluster->major_version) < 903) ?
>
> , in my case i change it to:
>
> 199:       (GET_MAJOR_VERSION(cluster->major_version) < 900) ?"
>
>
> Clodoaldo

Yep, looks like Fedora has to patch pg_upgrade too.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +