Where can I find the pg_config binary in PostgreSQL 14?

2021-10-01 Thread Oskar Stenberg
Hi!

I'm developing an application with PostgreSQL as the database. But
during the compilation I need to use pg_config to get the paths of the
other PostgreSQL files. But since upgrading to PostgreSQL 14 I can't
find it anymore. Earlier I got this binary from libpq-devel (I'm using
fedora as my workstation and Rocky Linux/CentOS on the database server)
but that package has been replaced by postgresql14-devel according to
DNF. But from what I can see it doesn't contain the pg_config binary?
It seems to contain some headers for it but not the actual binary. Has
it been removed/moved on purpose from the new version? And if so where
do I find this functionality now? Is there another way to get those
paths in a simple manner? :)


Thanks in advance!

Best Regards
Oskar


Re: Where can I find the pg_config binary in PostgreSQL 14?

2021-10-01 Thread Oskar Stenberg
Never mind... I found it!

For anyone else that has the same problem:  It had been moved to
"/usr/pgsql-14/bin/pg_config"

Sorry for disturbing everyone with this... *Facepalm*

On Fri, 2021-10-01 at 12:12 +0200, Oskar Stenberg wrote:
> Hi!
> 
> I'm developing an application with PostgreSQL as the database. But
> during the compilation I need to use pg_config to get the paths of
> the other PostgreSQL files. But since upgrading to PostgreSQL 14 I
> can't find it anymore. Earlier I got this binary from libpq-devel
> (I'm using fedora as my workstation and Rocky Linux/CentOS on the
> database server) but that package has been replaced by postgresql14-
> devel according to DNF. But from what I can see it doesn't contain
> the pg_config binary? It seems to contain some headers for it but not
> the actual binary. Has it been removed/moved on purpose from the new
> version? And if so where do I find this functionality now? Is there
> another way to get those paths in a simple manner? :)
> 
> 
> Thanks in advance!
> 
> Best Regards
> Oskar


Re: Sysbench tests on PG12

2021-10-01 Thread Laurenz Albe
On Fri, 2021-10-01 at 14:22 +0530, Subhrajyoti Senapati wrote:
> Was running a few sysbench tests in Postgres12.
> Sysbench Test Config
> oltp-readwrite-custom
> Threads - 500
> Machine: 16 core 64G
> 
> In PG server:
> shared_buffers: 16GB
> maintenance_work_memory: 16GB
> checkpoint_timeout: 1h
> max_wal_size: 10GB
> wal_sync_method: 'open_sync'
> effective_cache_size: 32GB
> wal_buffers: -1
> wal_compression: on
> 
> Got some qps dips.
> 
> Changed fsync and full_page_rewrite to 'off'.
> Which helped in avoiding these many long dips in performance:
> 
> But fsync ensures DBMS consistency. So, instead of that can I change a few 
> other configurations to avoid these inconsistent performance dips ?

Try playing with "bgwriter_flush_after", "checkpoint_flush_after" and 
"wal_writer_flush_after"
and see if that influences the behavior.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com





Re: Sysbench tests on PG12

2021-10-01 Thread Subhrajyoti Senapati
Thanks Laurenz, will try these flags.

Regards,
Subhrajyoti

On Fri, Oct 1, 2021 at 5:19 PM Laurenz Albe 
wrote:

> On Fri, 2021-10-01 at 14:22 +0530, Subhrajyoti Senapati wrote:
> > Was running a few sysbench tests in Postgres12.
> > Sysbench Test Config
> > oltp-readwrite-custom
> > Threads - 500
> > Machine: 16 core 64G
> >
> > In PG server:
> > shared_buffers: 16GB
> > maintenance_work_memory: 16GB
> > checkpoint_timeout: 1h
> > max_wal_size: 10GB
> > wal_sync_method: 'open_sync'
> > effective_cache_size: 32GB
> > wal_buffers: -1
> > wal_compression: on
> >
> > Got some qps dips.
> >
> > Changed fsync and full_page_rewrite to 'off'.
> > Which helped in avoiding these many long dips in performance:
> >
> > But fsync ensures DBMS consistency. So, instead of that can I change a
> few other configurations to avoid these inconsistent performance dips ?
>
> Try playing with "bgwriter_flush_after", "checkpoint_flush_after" and
> "wal_writer_flush_after"
> and see if that influences the behavior.
>
> Yours,
> Laurenz Albe
> --
> Cybertec | https://www.cybertec-postgresql.com
>
>


Re: postgresql11: How to use publication/subscription on primary/standby setup

2021-10-01 Thread Tomas Pospisek

On 29.09.21 11:01, Abhishek B wrote:
Is there a solution to use publication/subscription on a master-slave or 
primary-standby postgres setup without manual intervention?


Currently the DB clusters are managed by Pacemaker. Once there is a 
failover, the pacemaker is able to promote the secondary node to 
primary, but the logical replication stops working after that. Is there 
any way to automatically move the contents of pg_replslot to the new 
primary node?


I'm not sure I understand you correctly, but I'd suggest to have a look 
at patroni, which maybe does what you want.

*t