remgr installation and configuration steps required

2020-10-17 Thread Atul Kumar
Hi,

I have 3 different servers, i want to configure streaming replication
(1 master and 2 slaves) using repmanager.

Please share the installation and configuration steps for the same.

Note: the steps should be organized.


Regards,
Atul




Re: remgr installation and configuration steps required

2020-10-17 Thread Ian Lawrence Barwick
2020年10月17日(土) 23:25 Atul Kumar :
>
> Hi,
>
> I have 3 different servers, i want to configure streaming replication
> (1 master and 2 slaves) using repmanager.
>
> Please share the installation and configuration steps for the same.
>
> Note: the steps should be organized.

I suggest starting with the Quickstart Guide:

https://repmgr.org/docs/current/quickstart.html

This recent blog article might also be of use:


https://www.2ndquadrant.com/en/blog/how-to-automate-postgresql-12-replication-and-failover-with-repmgr-part-1/

(despite the title it is relevant for other PostgreSQL versions too).

Regards

Ian Barwick
-- 
EnterpriseDB: https://www.enterprisedb.com




Pgpool2 Service Won't Start

2020-10-17 Thread alanhi
Hi,

Hi, my pgpool status indicates that it failed even after trying to restart
the service.  What can I check to see what configurations may be causing
this?  Thanks.

Alan

● pgpool2.service - pgpool-II
   Loaded: loaded (/lib/systemd/system/pgpool2.service; enabled; vendor
preset: enabled)
   Active: failed (Result: exit-code) since Fri 2020-10-16 10:16:21 HST;
10min ago
 Docs: man:pgpool(8)
  Process: 20052 ExecStart=/usr/sbin/pgpool -n (code=exited, status=3)
 Main PID: 20052 (code=exited, status=3)





--
Sent from: https://www.postgresql-archive.org/PostgreSQL-general-f1843780.html




print formated special characteres

2020-10-17 Thread Celso Lorenzetti
Hi all,



Somebody help me, please.

How to make the texts are aligned with 10 characters?



elog(INFO, "\n%-10s Fim\n%-10s Fim\n", "Variável", "Variavel");



Output:

INFO:

Variável  Fim

Variavel   Fim





thank you





Att,

Assinatura Outlook





--
Este email foi escaneado pelo Avast antivírus.
https://www.avast.com/antivirus


Re: print formated special characteres

2020-10-17 Thread Matthias Apitz
El día sábado, octubre 17, 2020 a las 03:37:46p. m. -0300, Celso Lorenzetti 
escribió:

> Somebody help me, please.
> 
> How to make the texts are aligned with 10 characters?
> 
> 
> 
> elog(INFO, "\n%-10s Fim\n%-10s Fim\n", "Variável", "Variavel");

Hola Celso,

You can reproduce the same on the UNIX shell with:

$ printf "\n%-10s Fim\n%-10s Fim\n" "Variável" "Variavel"

Variável  Fim
Variavel   Fim


$ printf "\n%-10s Fim\n%-10s Fim\n" "VariXvel" "Variavel"

VariXvel   Fim
Variavel   Fim

The second test (changing the accented char 'á' by 'X'), shows that the
problem/bug is a) more generic, not only in PostgreSQL and b) has todo
with being the UTF-8 char 'á' a two byte char, while 'X' is only one
byte.

I have no solution, though at the moment...

Obrigado

matthias

-- 
Matthias Apitz, ✉ g...@unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub
Без книги нет знания, без знания нет коммунизма (Влaдимир Ильич Ленин)
Without books no knowledge - without knowledge no communism (Vladimir Ilyich 
Lenin) 
Sin libros no hay saber - sin saber no hay comunismo. (Vladimir Ilich Lenin)




Re: print formated special characteres

2020-10-17 Thread Peter J. Holzer
On 2020-10-17 20:51:36 +0200, Matthias Apitz wrote:
> El día sábado, octubre 17, 2020 a las 03:37:46p. m. -0300, Celso Lorenzetti 
> escribió:
> 
> > Somebody help me, please.
> > 
> > How to make the texts are aligned with 10 characters?
> > 
> > 
> > 
> > elog(INFO, "\n%-10s Fim\n%-10s Fim\n", "Variável", "Variavel");

Which programming language is this? PL/pgSQL?

> Hola Celso,
> 
> You can reproduce the same on the UNIX shell with:
> 
> $ printf "\n%-10s Fim\n%-10s Fim\n" "Variável" "Variavel"
> 
> Variável  Fim
> Variavel   Fim

Hmm. Zsh gets it right:

trintignant:~ 0:31 :-) 1032% printf "\n%-10s Fim\n%-10s Fim\n" "Variável" 
"Variavel"

Variável   Fim
Variavel   Fim

As do Perl and Python.


> The second test (changing the accented char 'á' by 'X'), shows that the
> problem/bug is a) more generic, not only in PostgreSQL and b) has todo
> with being the UTF-8 char 'á' a two byte char, while 'X' is only one
> byte.

Yes, determining how much space a UTF-8 sequence occupies on screen is
surprisingly hard. I'm not sure what the C standard says about that. But
these days I would expect any programming language to get it right at
least for the simple cases.

hp

-- 
   _  | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| |   | h...@hjp.at |-- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |   challenge!"


signature.asc
Description: PGP signature


Re: print formated special characteres

2020-10-17 Thread Tom Lane
"Peter J. Holzer"  writes:
> On 2020-10-17 20:51:36 +0200, Matthias Apitz wrote:
>> El día sábado, octubre 17, 2020 a las 03:37:46p. m. -0300, Celso Lorenzetti 
>> escribió:
>>> elog(INFO, "\n%-10s Fim\n%-10s Fim\n", "Variável", "Variavel");

> Which programming language is this? PL/pgSQL?

Looks like C in the backend.

>> The second test (changing the accented char 'á' by 'X'), shows that the
>> problem/bug is a) more generic, not only in PostgreSQL and b) has todo
>> with being the UTF-8 char 'á' a two byte char, while 'X' is only one
>> byte.

> Yes, determining how much space a UTF-8 sequence occupies on screen is
> surprisingly hard. I'm not sure what the C standard says about that. But
> these days I would expect any programming language to get it right at
> least for the simple cases.

Our version of snprintf intentionally counts bytes not characters,
so that it does not have to make assumptions about what encoding
the given string uses.  It's somewhat unclear whether the C/POSIX
standard mandates either of these interpretations.  The GNU
implementation of snprintf tries to count characters.  But in the
cases where that's mattered to us at all, it's generally been the
wrong thing, because glibc didn't necessarily know the encoding to
use.  That's one reason why we stopped relying on libc's snprintf.

The way to get this to work as Celso wishes would be to count
characters and then do his own arithmetic about how much padding
to add.

regards, tom lane




Re: Pgpool2 Service Won't Start

2020-10-17 Thread Bo Peng
Hi,

On Fri, 16 Oct 2020 14:33:33 -0700 (MST)
alanhi  wrote:

> Hi,
> 
> Hi, my pgpool status indicates that it failed even after trying to restart
> the service.  What can I check to see what configurations may be causing
> this?  Thanks.
> 
> Alan
> 
> ● pgpool2.service - pgpool-II
>Loaded: loaded (/lib/systemd/system/pgpool2.service; enabled; vendor
> preset: enabled)
>Active: failed (Result: exit-code) since Fri 2020-10-16 10:16:21 HST;
> 10min ago
>  Docs: man:pgpool(8)
>   Process: 20052 ExecStart=/usr/sbin/pgpool -n (code=exited, status=3)
>  Main PID: 20052 (code=exited, status=3)

You may go to https://www.pgpool.net/mailman/listinfo/pgpool-general to ask 
questions.
Could you share the result of "systemctl status pgpool" and pgpool log?
 
> --
> Sent from: https://www.postgresql-archive.org/PostgreSQL-general-f1843780.html
> 
> 


-- 
Bo Peng 
SRA OSS, Inc. Japan