could not access file "pg_wait_sampling": No such file or directory postgresql - postgresql

after I use the following command then I cannot relogin postgresql
alter system set shared_preload_libraries = 'pg_wait_sampling';
exit trying login again. Then error happens. The following is error code:
2022-03-15 11:35:30.726 IST [975] FATAL: could not access file "pg_wait_sampling": No such file or directory
2022-03-15 11:35:30.727 IST [975] LOG: database system is shut down
pg_ctl: could not start server
Examine the log output.
postgresql version: 14.2. system: wsl ubuntu.
in conf file /etc/postgresql/14/main/postgresql.conf":
#shared_preload_libraries='' #(change requires restart)

According to PostgreSQL document alter command store in postgresql.auto.conf file.
You have to change this file and remove pg_wait_sampling form this file

Related

Initializing data directory for postgresql not successful

I tried to initialize the postgresql data directory, and I get this error :
[postgres#vix-db1-1 ~]$ /usr/pgsql-9.5/bin/initdb --nodename=vix-db1-1 -D /var/lib/pgsql/9.5/data
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
creating directory /var/lib/pgsql/9.5/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
creating template1 database in /var/lib/pgsql/9.5/data/base/1 ... ok
initializing pg_authid ... ok
initializing dependencies ... ok
creating system views ... ok
creating cluster information ... FATAL: syntax error at or near "-" at character 16
STATEMENT: CREATE NODE vix-db1-1 WITH (type = 'coordinator');
child process exited with exit code 1
initdb: removing data directory "/var/lib/pgsql/9.5/data"
It says “FATAL: syntax error at or near “-” at character 16”; but the hostname has to have the “-” due to new server version.
I tried doing it without nodename, but for that another problem :
[postgres#vix-db1-1 ~]$ /usr/pgsql-9.5/bin/initdb -D /var/lib/pgsql/9.5/data
initdb: Postgres-XL node name is mandatory
Try "initdb --help" for more information.
[postgres#vix-db1-1 ~]$
How do I resolve this?
You must be using some fork of PostgreSQL, since initdb does not have a --nodename parameter.
Whoever wrote that fork didn't do a very good job, since they forgot to properly escape special characters somewhere. You should report that as a bug to the software vendor.
#anaigini I'll move the comment to answer since it worked:
You may have to pass the name in quotes, so that it substitutes in the
query, using --nodename='"vix-db1-1"'. The outer single-quotes will be
used by the shell, leaving the inner double-quotes for the query.

Can not create backup of Firebird database because of the errors

At the time of backup firebird database (gbak -g -ig) I have the following error:
gbak: writing data for table ORDERS
gbak: ERROR:message length error (encountered 532, expected 528)
gbak: ERROR:gds_$receive failed
gbak:Exiting before completion due to errors
When I'm using gfix with different parameters (-v -full, -mend, -ignore), I have the message:
Summary of validation errors
Number of index page errors : 540
In firebird.log file I see the lines:
PC (Server) Thu Sep 20 08:37:01 2018
Database: E:\...GDB
Index 2 is corrupt on page 134706 level 1. File: ..\..\..\src\jrd\validation.cpp, line: 1699
in table COMPONENTS (197)
However, the database works OK without problems.
Please help me to fix the error and make a backup.
(I need the backup to migrate to on 64bit server).

ERROR could not access file "$libdir/repmgr_funcs" No such file or directory

I follow this link to create master slave replication on Ubuntu postgresql server.
My Configuration of repmgr and postgresql are:
Postgresql 9.5-: /opt/PostgreSQL/9.5/
repmgr-: /usr/lib/postgresql/9.5/bin/repmgr
repmgr.conf -: /etc/rep.conf
pg_config --pkglibdir => /usr/lib/postgresql/9.5/lib
ls /usr/lib/postgresql/9.5/lib | grep repmgr_funcs => repmgr_funcs.so
I am getting ERROR-: unable to create the function
repmgr_update_last_updated: ERROR: could not access file "$libdir/repmgr_funcs": No such file or directory
ERROR: Unable to create repmgr schema - see preceding error message(s); aborting
If you are using repmgr ver. 4 and above then you need to change in postgresql.conf
From shared_preload_libraries = 'repmgr_funcs'
To shared_preload_libraries = 'repmgr'
Below are their upgrade notes
The repmgr shared library has been renamed from repmgr_funcs to
repmgr, meaning shared_preload_libraries in postgresql.conf needs to
be updated to the new name: shared_preload_libraries = 'repmgr'

after lein ring server, I get error PSQLException no password was provided

I am naive in Postgres and clojure
I wanted to run this https://gitlab.com/dzaporozhets/clojure-picture-gallery
Install
git clone https://gitlab.com/clojure-code-examples/picture-gallery.git
cd picture-gallery
# Install dependencies
lein deps
# Create database
psql -c 'CREATE DATABASE gallery TEMPLATE template0'
Running
To start a web server for the application, run:
lein ring server
this is process I have to do.
1)) I had to git clone but git clone have not worked. they want to let me type id, password. like this:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\jiji>git clone https://gitlab.com/clojure-code-examples/picture-gallery
.git
Cloning into 'picture-gallery'...
Username for 'https://gitlab.com': ji
Password for 'https://ji#gitlab.com':
fatal: Authentication failed for 'https://gitlab.com/clojure-code-examples/pictu
re-gallery.git/'
C:\Users\jiji>
anyway I downloaded source from web and unzip this file
2) I have problem when I write psql -c 'CREATE DATABASE gallery TEMPLATE template0'. I use Windows 7. Though I installed postgresql, 'psql' instruction have not worked in cmd window. I don't know how I can use 'psql' instruction in window. anyway I make gallery database like this
3) and I write lein ring server in cmd window
but I got error like this:
C:\Users\jiji\clojureproject\clojure-picture-gallery-master>lein ring server
picture-gallery is starting
Exception in thread "main" org.postgresql.util.PSQLException: The server request
ed password-based authentication, but no password was provided., compiling:(C:\U
sers\jiji\AppData\Local\Temp\form-init366034846235691962.clj:1:105)
at clojure.lang.Compiler.load(Compiler.java:7142)
at clojure.lang.Compiler.loadFile(Compiler.java:7086)
at clojure.main$load_script.invoke(main.clj:274)
at clojure.main$init_opt.invoke(main.clj:279)
at clojure.main$initialize.invoke(main.clj:307)
at clojure.main$null_opt.invoke(main.clj:342)
at clojure.main$main.doInvoke(main.clj:420)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at clojure.lang.Var.invoke(Var.java:383)
at clojure.lang.AFn.applyToHelper(AFn.java:156)
at clojure.lang.Var.applyTo(Var.java:700)
at clojure.main.main(main.java:37)
Caused by: org.postgresql.util.PSQLException: The server requested password-base
d authentication, but no password was provided.
at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(Connect
ionFactoryImpl.java:473)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(Conne
ctionFactoryImpl.java:203)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactor
y.java:65)
at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Conn
ection.java:146)
at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Conn
ection.java:35)
at org.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>(AbstractJdbc3gC
onnection.java:22)
at org.postgresql.jdbc4.AbstractJdbc4Connection.<init>(AbstractJdbc4Conn
ection.java:47)
at org.postgresql.jdbc4.Jdbc4Connection.<init>(Jdbc4Connection.java:30)
at org.postgresql.Driver.makeConnection(Driver.java:414)
at org.postgresql.Driver.connect(Driver.java:282)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:208)
at clojure.java.jdbc$get_connection.invoke(jdbc.clj:177)
at clojure.java.jdbc$get_connection.invoke(jdbc.clj:161)
at clojure.java.jdbc$get_connection.invoke(jdbc.clj:164)
at clojure.java.jdbc$with_connection_STAR_.invoke(jdbc.clj:300)
at picture_gallery.models.schema$table_exists_QMARK_.invoke(schema.clj:2
8)
at picture_gallery.models.schema$migrate.invoke(schema.clj:35)
at picture_gallery.handler$init.invoke(handler.clj:18)
at clojure.lang.Var.invoke(Var.java:375)
at ring.server.standalone$serve.doInvoke(standalone.clj:93)
at clojure.lang.RestFn.invoke(RestFn.java:423)
at ring.server.leiningen$serve.invoke(leiningen.clj:20)
at user$eval6633.invoke(form-init366034846235691962.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:6703)
at clojure.lang.Compiler.eval(Compiler.java:6693)
at clojure.lang.Compiler.load(Compiler.java:7130)
... 11 more
Subprocess failed
C:\Users\jiji\clojureproject\clojure-picture-gallery-master>
I guess it is password problem. but I don't know what it means
in short I have three question about 1)),2)),3)) why they are not worked?
answerto question 3)
take a look at /src/picture_gallery/models/db.clj here https://gitlab.com/dzaporozhets/clojure-picture-gallery/blob/master/src/picture_gallery/models/db.clj#L4
either set you DATABASE_URL environment variable to contain valid postgres connection url or just use
(def db (or (System/getenv "DATABASE_URL")
"postgresql://user:password#localhost:5432/gallery"))
replace user and password before #localhost with your postgres's user and password

DB2 9.5 CREATE DATABASE fails with Error SQL0901N, SQLSTATE 58004

Installed DB2 on Windows Vista with Admin priviledges.
Now i cannot create any new databases.. it always fails with the following error:
db2 CREATE DATABASE N3000 AUTOMATIC STORAGE YES ON 'D:\DB2'
DBPATH ON 'D:\DB2'
SQL0901N Die SQL-Anweisung schlug aufgrund eines nicht schwer wiegenden
(nicht kritischen) Systemfehlers fehl. Nachfolgende SQL-Anweisungen können
verarbeitet werden. (Ursachencode: "Length in PD=0, LFD length=1176, DMS
length=1176".) SQLSTATE=58004
Any ideas how to fix this?
in db2 directory:
c:\program files\ibm\sqllib\bin
execute:
db2set DB2_CREATE_DB_ON_PATH=YES
db2stop
db2start
Ready, now you create DB2 Databases in any path!!!!
look this: http://www.db2ude.com/?q=node/54
The problem was caused by an antivirus policy and was unrelated to DB2.
The file "C0000000.CAT" has to be excluded.