Re: Unknown temp directories and library files

2024-10-13 Thread Adrian Klaver

On 10/13/24 11:34, Priancka Chatz wrote:

Hi Adrian,

There is patroni and pgqd running on the server. So possibly these are 
using psycopg2.


You are  going to have investigate what is actually repeatedly 
installing psycopg2-binary and psycopg2.


Steps I can think of to do this:

1) Sort the temp directories by timestamp and see if there is a pattern.

2) Look at the OS system log for entries at the above timestamps.

3) Do same for Postgres log.



Regards,
Priyanka



--
Adrian Klaver
adrian.kla...@aklaver.com





Hello, how should I fix it?

2024-10-13 Thread 吴 其键
service postgresql start
Starting PostgreSQL 16 database server: mainError: 
/usr/lib/postgresql/16/bin/pg_ctl /usr/lib/postgresql/16/bin/pg_ctl start -D 
/var/lib/postgresql/16/main -l /var/log/postgresql/postgresql-16-main.log -s -o 
 -c config_file="/etc/postgresql/16/main/postgresql.conf"  exited with status 1:
2024-10-13 12:55:21.553 UTC [16727] FATAL:  could not create shared memory 
segment: Function not implemented
2024-10-13 12:55:21.553 UTC [16727] DETAIL:  Failed system call was 
shmget(key=6644951, size=56, 03600).
2024-10-13 12:55:21.553 UTC [16727] LOG:  database system is shut down
pg_ctl: could not start server
Examine the log output. ... failed!
 failed!

获取Outlook for Android


Re: Unknown temp directories and library files

2024-10-13 Thread Adrian Klaver

On 10/10/24 11:36, Priancka Chatz wrote:

Hi admins,

I am observing a new/unknown behavior on some of my instances. My 
postgres Data directory path is /home/postgres/pgdata/pgroot/data. And I 
see a temp directory present inside /home/postgres/pgdata which has 100s 
of directory underneath it and inside each directory some library files 
related to Psycopg2. Not sure what these files are and why it is getting 
created. However, the only pattern I found is wherever Postgres is down 
this behavior is seen.


They are coming from an install of psycopg2-binary:

pip install psycopg2-binary

ll lib/python3.12/site-packages/psycopg2_binary.libs/
total 6944
drwxrwxr-x   2 aklaver aklaver4096 Oct 13 08:55 ./
drwxrwxr-x 348 aklaver aklaver   20480 Oct 13 08:55 ../
-rwxrwxr-x   1 aklaver aklaver   17497 Oct 13 08:55 
libcom_err-2abe824b.so.2.1*
-rwxrwxr-x   1 aklaver aklaver 3133185 Oct 13 08:55 
libcrypto-0628e7d4.so.1.1*
-rwxrwxr-x   1 aklaver aklaver  345209 Oct 13 08:55 
libgssapi_krb5-497db0c6.so.2.2*
-rwxrwxr-x   1 aklaver aklaver  219953 Oct 13 08:55 
libk5crypto-b1f99d5c.so.3.1*
-rwxrwxr-x   1 aklaver aklaver   17913 Oct 13 08:55 
libkeyutils-dfe70bd6.so.1.5*

-rwxrwxr-x   1 aklaver aklaver 1018953 Oct 13 08:55 libkrb5-fcafa220.so.3.3*
-rwxrwxr-x   1 aklaver aklaver   76873 Oct 13 08:55 
libkrb5support-d0bcff84.so.0.1*
-rwxrwxr-x   1 aklaver aklaver   60977 Oct 13 08:55 
liblber-5a1d5ae1.so.2.0.200*
-rwxrwxr-x   1 aklaver aklaver  447329 Oct 13 08:55 
libldap-5d2ff197.so.2.0.200*
-rwxrwxr-x   1 aklaver aklaver  406817 Oct 13 08:55 
libpcre-9513aab5.so.1.2.0*

-rwxrwxr-x   1 aklaver aklaver  370777 Oct 13 08:55 libpq-e8a033dd.so.5.16*
-rwxrwxr-x   1 aklaver aklaver  119217 Oct 13 08:55 
libsasl2-883649fd.so.3.0.0*
-rwxrwxr-x   1 aklaver aklaver  178337 Oct 13 08:55 
libselinux-0922c95c.so.1*

-rwxrwxr-x   1 aklaver aklaver  646065 Oct 13 08:55 libssl-3e69114b.so.1.1*


Looks like something is setting up psycopg2-binary and psycopg2 as part 
of some script/tool/orm/etc in your $DATA directory.


Are you using something that uses psycopg2 as the client library?



I am attaching screenshots for reference.

Can anyone shed some light or direct me to any links to troubleshoot this?

Regards,
Priyanka


--
Adrian Klaver
adrian.kla...@aklaver.com





Connection between PostgreSQL and SAP HANA database

2024-10-13 Thread Thürmann , Andreas
Yes I run it under Windows, I also have a Linux server for testing.
Under Windows I know that the driver works because i use it already in another 
project (MS SQL Server with LinkedServer).
In Linux I can test the HDBODBC driver via command line and the ISQL command, 
this works fine.

I'm desperate about the PostgreSQL configuration. I have no idea how to 
configure it. I doubt the path (HDBODBC (SAP-driver) –> SAP HANA database) 
myself, but i cant connect to the HDBODBC driver directly via an extension.
My previous assumption was that i need a extension for the foreign data 
wrapper, the foreign server, foreign table and so on...

How can I use the system dsn in PostgreSQL?


-Ursprüngliche Nachricht-

Mit freundlichen Grüßen

i. A. Andreas Thuermann
Teamleitung IT-Applikationen & BI
IT-Applikationen & BI

Schoenmackers Umweltdienste GmbH & Co. KG
Hooghe Weg 1
47906 Kempen

Tel:+49 (2152) 207 6765
Fax:
E-Mail: andreas.thuerm...@schoenmackers.de

Schönmackers Umweltdienste GmbH & Co KG, Hooghe Weg 1, 47906 Kempen, Sitz: 
Kempen, Amtsgericht Krefeld, HRA 3763,
p.h.G.: Schönmackers Umweltdienste Verwaltung GmbH, Sitz: Kempen, Amtsgericht 
Krefeld, HRB 6153,
Geschäftsführer: Sabrina Michelbrink, Oliver Zimmermann
https://www.schoenmackers.de

Hier geht es direkt zum Shop: https://www.schoenmackers.de/containershop



Von: Adrian Klaver 
Gesendet: Donnerstag, 10. Oktober 2024 17:46
An: Thürmann, Andreas ; 
'pgsql-general@lists.postgresql.org' 
Betreff: Re: Connection between PostgreSQL and SAP HANA database

On 10/10/24 02:54, Thürmann, Andreas wrote:
> Please excuse the late reply. I didn't have time to continue working
> on this project.
>
> I still don't get a response to the query. The query continues
> indefinitely and the data output window shows only „Waiting for the
> query to complete...“
>
> In the SAP HANA logs i can’t find any access of my PostgreSQL-query,
> the Microsoft solution works perfectly and is visible in the log.

Are you running this on Windows?

>
> Is it not possible to connect to the SAP HANA database with PostgreSQL
> or are there errors in my setup?
>
> My current expectation of the data stream: PostgreSQL -> odbc_fdw ->
> HDBODBC (SAP-driver) –> SAP HANA database

Does this:

HDBODBC (SAP-driver) –> SAP HANA database

work?

Meaning, does test connection complete successfully.

What are the settings for odbc_fdw and the SAP driver?

>
> But how can I set up the connection between the two ODBC drivers?
>
> Has anyone already implemented a project like this and can tell me how
> to establish the connection to SAP?
>
>  > Adrian Klaver (adrian.kla...@aklaver.com
> 
>
>  >  >) asked:
>
>  >
>
>  > Postgres version?
>
>  >
>
>  > PostgreSQL 16 with pgAdmin 16 4.2.2
>
> Have you tried tried this using psql?
>
>  > Have you looked at Postgres log for errors?
>
>  >
>
>  >  No errors during the query in the log, only a
>
>  > „unrecognized winsock error 10054“ at the start of the pg client
>
> Have you looked at the SAP HANA logs to see if a connection is even
> attempted?
>
> Ron Johnson (ronljohnso...@gmail.com )
> asked me the following. Answers below:
>
> 1. What error did you get?
>
> No error, the query runns into infinity (>30 min.) without a result.
>
> 2. Which command caused the error?
>
> Test-query like SELECT * FROM hana_table LIMIT 10;
>
> 3. What version of the odbc_fdw are you using?
>
> Latest, Version 0.5.2
>
> 4. What version of Postgresql are you using?
>
> PostgreSQL 16 with pgAdmin 16 4.2.2
>
> Adrian Klaver (adrian.kla...@aklaver.com
> ) asked:
>
> Postgres version?
>
> PostgreSQL 16 with pgAdmin 16 4.2.2
>
> SAP HANA version?
>
> SAP HANA database 2.00.07400
>
> odbc_fdw version and where did you get it from?
>
>  I use the odbc_fdw from
> https://www.postgresonline.com/journal/index.php?/archives/409-Postgre
> SQL-16-64-bit-for-Windows-FDWs.html
>  eSQL-16-64-bit-for-Windows-FDWs.html>
>
> How do you know you are not making a connection?
>
>  No results from the query, no suggestions in the
> foreign table creation menu
>
> Have you looked at Postgres log for errors?
>
>  No errors during the query in the log, only a
> „unrecognized winsock error 10054“ at the start of the pg client
>
> Hello everyone,
>
> I'm currently trying to establish a connection between PostgreSQL and
> a SAP HANA database. Unfortunately, so far without success.
>
> SAP's own ODBC driver works correctly and I can query the HANA
> database using an ISQL command. However, I can't establish a
> connection from PostgreSQL.
>
> I used the following commands to establish the connection:
>
> CREATE SERVER hana_server
>
> FOREIGN DATA WRAPPER odbc_fdw
>
> OPTIONS (dsn 'SAP_ODBC_DNS');

Re: Hello, how should I fix it?

2024-10-13 Thread Adrian Klaver

On 10/13/24 05:57, 吴 其键 wrote:

service postgresql start
Starting PostgreSQL 16 database server: mainError: 
/usr/lib/postgresql/16/bin/pg_ctl /usr/lib/postgresql/16/bin/pg_ctl 
start -D /var/lib/postgresql/16/main -l 
/var/log/postgresql/postgresql-16-main.log -s -o  -c 
config_file="/etc/postgresql/16/main/postgresql.conf"  exited with status 1:
2024-10-13 12:55:21.553 UTC [16727] FATAL:  could not create shared 
memory segment: Function not implemented
2024-10-13 12:55:21.553 UTC [16727] DETAIL:  Failed system call was 
shmget(key=6644951, size=56, 03600).

2024-10-13 12:55:21.553 UTC [16727] LOG:  database system is shut down
pg_ctl: could not start server
Examine the log output. ... failed!
  failed!



Need more information:

1) Exact Postgres version, so 16.x.

2) OS and version.

3) Where did you get the Postgres package from?


获取Outlook for Android 


--
Adrian Klaver
adrian.kla...@aklaver.com





Re: Hello, how should I fix it?

2024-10-13 Thread Erik Wienhold
On 2024-10-13 18:04 +0200, Adrian Klaver wrote:
> On 10/13/24 05:57, 吴 其键 wrote:
> > service postgresql start
> > Starting PostgreSQL 16 database server: mainError:
> > /usr/lib/postgresql/16/bin/pg_ctl /usr/lib/postgresql/16/bin/pg_ctl
> > start -D /var/lib/postgresql/16/main -l
> > /var/log/postgresql/postgresql-16-main.log -s -o  -c
> > config_file="/etc/postgresql/16/main/postgresql.conf"  exited with
> > status 1:
> > 2024-10-13 12:55:21.553 UTC [16727] FATAL:  could not create shared
> > memory segment: Function not implemented
> > 2024-10-13 12:55:21.553 UTC [16727] DETAIL:  Failed system call was
> > shmget(key=6644951, size=56, 03600).
> > 2024-10-13 12:55:21.553 UTC [16727] LOG:  database system is shut down
> > pg_ctl: could not start server
> > Examine the log output. ... failed!
> >   failed!
> > 
> 
> Need more information:
> 
> 1) Exact Postgres version, so 16.x.
> 
> 2) OS and version.

Also good to know if this is running in a virtualized environment that
does not allow or support SysV IPC.

> 3) Where did you get the Postgres package from?

-- 
Erik




Re: Unknown temp directories and library files

2024-10-13 Thread Priancka Chatz
Hi Adrian,

There is patroni and pgqd running on the server. So possibly these are
using psycopg2.

Regards,
Priyanka


On Sun, 13 Oct 2024 at 6:01 PM, Adrian Klaver 
wrote:

> On 10/10/24 11:36, Priancka Chatz wrote:
> > Hi admins,
> >
> > I am observing a new/unknown behavior on some of my instances. My
> > postgres Data directory path is /home/postgres/pgdata/pgroot/data. And I
> > see a temp directory present inside /home/postgres/pgdata which has 100s
> > of directory underneath it and inside each directory some library files
> > related to Psycopg2. Not sure what these files are and why it is getting
> > created. However, the only pattern I found is wherever Postgres is down
> > this behavior is seen.
>
> They are coming from an install of psycopg2-binary:
>
> pip install psycopg2-binary
>
> ll lib/python3.12/site-packages/psycopg2_binary.libs/
> total 6944
> drwxrwxr-x   2 aklaver aklaver4096 Oct 13 08:55 ./
> drwxrwxr-x 348 aklaver aklaver   20480 Oct 13 08:55 ../
> -rwxrwxr-x   1 aklaver aklaver   17497 Oct 13 08:55
> libcom_err-2abe824b.so.2.1*
> -rwxrwxr-x   1 aklaver aklaver 3133185 Oct 13 08:55
> libcrypto-0628e7d4.so.1.1*
> -rwxrwxr-x   1 aklaver aklaver  345209 Oct 13 08:55
> libgssapi_krb5-497db0c6.so.2.2*
> -rwxrwxr-x   1 aklaver aklaver  219953 Oct 13 08:55
> libk5crypto-b1f99d5c.so.3.1*
> -rwxrwxr-x   1 aklaver aklaver   17913 Oct 13 08:55
> libkeyutils-dfe70bd6.so.1.5*
> -rwxrwxr-x   1 aklaver aklaver 1018953 Oct 13 08:55
> libkrb5-fcafa220.so.3.3*
> -rwxrwxr-x   1 aklaver aklaver   76873 Oct 13 08:55
> libkrb5support-d0bcff84.so.0.1*
> -rwxrwxr-x   1 aklaver aklaver   60977 Oct 13 08:55
> liblber-5a1d5ae1.so.2.0.200*
> -rwxrwxr-x   1 aklaver aklaver  447329 Oct 13 08:55
> libldap-5d2ff197.so.2.0.200*
> -rwxrwxr-x   1 aklaver aklaver  406817 Oct 13 08:55
> libpcre-9513aab5.so.1.2.0*
> -rwxrwxr-x   1 aklaver aklaver  370777 Oct 13 08:55 libpq-e8a033dd.so.5.16*
> -rwxrwxr-x   1 aklaver aklaver  119217 Oct 13 08:55
> libsasl2-883649fd.so.3.0.0*
> -rwxrwxr-x   1 aklaver aklaver  178337 Oct 13 08:55
> libselinux-0922c95c.so.1*
> -rwxrwxr-x   1 aklaver aklaver  646065 Oct 13 08:55 libssl-3e69114b.so.1.1*
>
>
> Looks like something is setting up psycopg2-binary and psycopg2 as part
> of some script/tool/orm/etc in your $DATA directory.
>
> Are you using something that uses psycopg2 as the client library?
>
> >
> > I am attaching screenshots for reference.
> >
> > Can anyone shed some light or direct me to any links to troubleshoot
> this?
> >
> > Regards,
> > Priyanka
>
> --
> Adrian Klaver
> adrian.kla...@aklaver.com
>
>


repmgr 5.4.1 dependend package on RHEL9

2024-10-13 Thread Mukesh Tanuku
Hello everyone,

Question: We are installing *repmgr 5.4.1* along with postgres 15.6 on RHEL
9 and facing an issue with the dependent development package json-c
*-devel-0.14-11.el9.x86_64**.  *This package is not available on
RHEL repository so we have to enable EPEL repo (EPEL repository is a
community supported repository hosted by the Fedora Community) to download
the development tool on the RHEL9. There are some additional risks going
with this process. So what is the risk free way to use repmgr in RHEL9

Thanks to the community for active & prompt responses.

Regards
Mukesh T