Upgrading error
Hi, I have a postgresql server version 12.9 and trying to upgrade it to 14.5. My OS is Centos 8 Stream and I already managed to install postgresql14.5 but when I'm trying to upgrade, I am encountering this error bash-4.4$ /usr/pgsql-14/bin/pg_upgrade --old-datadir=/home/dmartuser/pgdata/data/ --new-datadir=/home/dmartuser/pgdata/data/ --old-bindir=/usr/pgsql-12/bin/ --new-bindir=/usr/pgsql-14/bin/ --check --verbose Running in verbose mode Performing Consistency Checks - Checking cluster versions This utility can only upgrade to PostgreSQL version 14. Failure, exiting I can't seem to find any solution in the internet. Please help! Sincerely, butching
Re: Upgrading error
Hi, Thanks for the reply! Sorry I missed that line, but now I'm having new error. [root@datamartds tmp]# sudo su postgres bash-4.4$ cd /tmp bash-4.4$ /usr/pgsql-14/bin/pg_upgrade --old-datadir=/home/dmartuser/pgdata/data/ --new-datadir=/home/dmartuser/pgsql/14/data/ --old-bindir=/usr/pgsql-12/bin/ --new-bindir=/usr/pgsql-14/bin/ --old-options '-c config_file=/var/lib/pgsql/12/data/postgresql.conf' --new-options '-c config_file=/var/lib/pgsql/14/data/postgresql.conf' --check Performing Consistency Checks - Checking cluster versions ok *failure* Consult the last few lines of "pg_upgrade_server.log" for the probable cause of the failure. connection to server on socket "/tmp/.s.PGSQL.50432" failed: No such file or directory Is the server running locally and accepting connections on that socket? could not connect to source postmaster started with the command: "/usr/pgsql-12/bin/pg_ctl" -w -l "pg_upgrade_server.log" -D "/home/dmartuser/pgdata/data" -o "-p 50432 -b -c config_file=/var/lib/pgsql/12/data/postgresql.conf -c listen_addresses='' -c unix_socket_permissions=0700 -c unix_socket_directories='/tmp'" start Failure, exiting Thanks, Chris Albert Navarroza Information Technology Officer I CTCO - ITDS - RDMD On Fri, Oct 21, 2022 at 10:08 PM Tom Lane wrote: > chris navarroza writes: > > bash-4.4$ /usr/pgsql-14/bin/pg_upgrade > > --old-datadir=/home/dmartuser/pgdata/data/ > > --new-datadir=/home/dmartuser/pgdata/data/ > --old-bindir=/usr/pgsql-12/bin/ > > --new-bindir=/usr/pgsql-14/bin/ --check --verbose > > Running in verbose mode > > Performing Consistency Checks > > - > > Checking cluster versions > > This utility can only upgrade to PostgreSQL version 14. > > You cannot use the same directory as --old-datadir and --new-datadir. > I think pg_upgrade is unhappy because what it sees in PG_VERSION in > the --new-datadir isn't v14 ... but I wonder if we shouldn't be > checking for this mistake more directly. > > Anyway, the right way to proceed is to use v14's initdb to create > a new directory at, say, /home/dmartuser/pgdata/data-14 > and then pg_upgrade to that. Afterwards you can rename the old > data directory out of the way and move the new one to > /home/dmartuser/pgdata/data, if you like. > > regards, tom lane >
Re: Upgrading error
This is the log I got. - pg_upgrade run on Mon Oct 24 07:41:13 2022 - command: "/usr/pgsql-12/bin/pg_ctl" -w -l "pg_upgrade_server.log" -D "/home/dmartuser/pgdata/data" -o "-p 50432 -b -c config_file=/var/lib/pgsql/12/data/postgresql.conf -c listen_addresses='' -c unix_socket_permissions=0700 -c unix_socket_directories='/tmp'" start >> "pg_upgrade_server.log" 2>&1 waiting for server to start2022-10-23 23:41:13.458 GMT [107444] LOG: skipping missing configuration file "/home/dmartuser/pgdata/data/postgresql.auto.conf" 2022-10-24 07:41:13.459 PST [107444] LOG: starting PostgreSQL 12.9 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-4), 64-bit 2022-10-24 07:41:13.460 PST [107444] LOG: listening on Unix socket "/tmp/.s.PGSQL.50432" 2022-10-24 07:41:13.486 PST [107444] LOG: redirecting log output to logging collector process 2022-10-24 07:41:13.486 PST [107444] HINT: Future log output will appear in directory "log". stopped waiting pg_ctl: could not start server Examine the log output. Thanks, Chris Albert Navarroza Information Technology Officer I CTCO - ITDS - RDMD On Mon, Oct 24, 2022 at 8:12 AM Tom Lane wrote: > chris navarroza writes: > > could not connect to source postmaster started with the command: > > "/usr/pgsql-12/bin/pg_ctl" -w -l "pg_upgrade_server.log" -D > > "/home/dmartuser/pgdata/data" -o "-p 50432 -b -c > > config_file=/var/lib/pgsql/12/data/postgresql.conf -c listen_addresses='' > > -c unix_socket_permissions=0700 -c unix_socket_directories='/tmp'" start > > Failure, exiting > > Did you look into the postmaster log (pg_upgrade_server.log, here) > to see what it thought about the problem? I'm guessing there's > something that kept it from starting, but there's no evidence > offered here about what. > > regards, tom lane >
PostgreSql Service different path
Hi, I install postgresql14.5 with the following commands sudo yum install postgresql14-server postgresql14-contrib sudo su postgres cd /tmp /usr/pgsql-14/bin/initdb -D /home/dmartuser/pgsql/14/data and update the postgresql.conf to the new path, now when I start the service, it has an error and when I check it says -- Unit postgresql-14.service has begun starting up. Oct 24 15:16:45 datamartds postgresql-14-check-db-dir[132338]: *"/var/lib/pgsql/14/data/" is missing or empty.* Oct 24 15:16:45 datamartds postgresql-14-check-db-dir[132338]: Use "/usr/pgsql-14/bin/postgresql-14-setup initdb" to initialize the database cluster. Oct 24 15:16:45 datamartds postgresql-14-check-db-dir[132338]: See /usr/share/doc/postgresql14/README.rpm-dist for more information. Oct 24 15:16:45 datamartds systemd[1]: postgresql-14.service: Control process exited, code=exited status=1 Oct 24 15:16:45 datamartds systemd[1]: postgresql-14.service: Failed with result 'exit-code'. How can I point the service to read the new path ( /home/dmartuser/pgsql/14/data )? Thanks, Chris Albert Navarroza Information Technology Officer I CTCO - ITDS - RDMD
Re: PostgreSql Service different path
But I'm using a different path when I initdb /usr/pgsql-14/bin/initdb -D */home/dmartuser/pgsql/14/data *so "/var/lib/pgsql/14/data/" is really empty. Is there a way to point the startup script to the new path */home/dmartuser/pgsql/14/data* ? Thanks, Chris Albert Navarroza Information Technology Officer I CTCO - ITDS - RDMD On Mon, Oct 24, 2022 at 6:57 PM Jeffrey Walton wrote: > On Mon, Oct 24, 2022 at 6:38 AM chris navarroza > wrote: > > > > I install postgresql14.5 with the following commands > > > > sudo yum install postgresql14-server postgresql14-contrib > > > > > > sudo su postgres > > > > cd /tmp > > > > /usr/pgsql-14/bin/initdb -D /home/dmartuser/pgsql/14/data > > > > and update the postgresql.conf to the new path, now when I start the > service, it has an error and when I check it says > > > > -- Unit postgresql-14.service has begun starting up. > > Oct 24 15:16:45 datamartds postgresql-14-check-db-dir[132338]: > "/var/lib/pgsql/14/data/" is missing or empty. > > Oct 24 15:16:45 datamartds postgresql-14-check-db-dir[132338]: Use > "/usr/pgsql-14/bin/postgresql-14-setup initdb" to initialize the database > cluster. > > Oct 24 15:16:45 datamartds postgresql-14-check-db-dir[132338]: See > /usr/share/doc/postgresql14/README.rpm-dist for more information. > > Oct 24 15:16:45 datamartds systemd[1]: postgresql-14.service: Control > process exited, code=exited status=1 > > Oct 24 15:16:45 datamartds systemd[1]: postgresql-14.service: Failed > with result 'exit-code'. > > > > How can I point the service to read the new path ( > /home/dmartuser/pgsql/14/data )? > > The startup script that is calling systemd should perform a `mkdir -p > /var/lib/pgsql/14/data` before calling the PostgreSQL binary. > > Jeff >
Re: PostgreSql Service different path
I fixed it by editing the postgresql-14.service PGDATA path to the new directory Thanks, butching On Mon, Oct 24, 2022 at 7:25 PM chris navarroza wrote: > But I'm using a different path when I initdb /usr/pgsql-14/bin/initdb -D > */home/dmartuser/pgsql/14/data > *so "/var/lib/pgsql/14/data/" is really empty. Is there a way to point > the startup script to the new path */home/dmartuser/pgsql/14/data* ? > > Thanks, > > Chris Albert Navarroza > Information Technology Officer I > CTCO - ITDS - RDMD > > > On Mon, Oct 24, 2022 at 6:57 PM Jeffrey Walton wrote: > >> On Mon, Oct 24, 2022 at 6:38 AM chris navarroza >> wrote: >> > >> > I install postgresql14.5 with the following commands >> > >> > sudo yum install postgresql14-server postgresql14-contrib >> > >> > >> > sudo su postgres >> > >> > cd /tmp >> > >> > /usr/pgsql-14/bin/initdb -D /home/dmartuser/pgsql/14/data >> > >> > and update the postgresql.conf to the new path, now when I start the >> service, it has an error and when I check it says >> > >> > -- Unit postgresql-14.service has begun starting up. >> > Oct 24 15:16:45 datamartds postgresql-14-check-db-dir[132338]: >> "/var/lib/pgsql/14/data/" is missing or empty. >> > Oct 24 15:16:45 datamartds postgresql-14-check-db-dir[132338]: Use >> "/usr/pgsql-14/bin/postgresql-14-setup initdb" to initialize the database >> cluster. >> > Oct 24 15:16:45 datamartds postgresql-14-check-db-dir[132338]: See >> /usr/share/doc/postgresql14/README.rpm-dist for more information. >> > Oct 24 15:16:45 datamartds systemd[1]: postgresql-14.service: Control >> process exited, code=exited status=1 >> > Oct 24 15:16:45 datamartds systemd[1]: postgresql-14.service: Failed >> with result 'exit-code'. >> > >> > How can I point the service to read the new path ( >> /home/dmartuser/pgsql/14/data )? >> >> The startup script that is calling systemd should perform a `mkdir -p >> /var/lib/pgsql/14/data` before calling the PostgreSQL binary. >> >> Jeff >> >
system variable can be edited by all user?
Hi, Ive created a read only user (SELECT PRIVILEGE) but it turns out that this user can do this queries: SHOW work_mem; SET work_mem='40MB'; How do I limit him? Thanks, Butching