Re: logical replication - negative bitmapset member not allowed

2019-11-09 Thread Peter Eisentraut

On 2019-11-07 16:18, Jehan-Guillaume de Rorthais wrote:

On Thu, 7 Nov 2019 16:02:21 +0100
Peter Eisentraut  wrote:


On 2019-11-05 17:05, Jehan-Guillaume de Rorthais wrote:

I have simplified your reproduction steps from the previous message to a
test case, and I can confirm that your proposed fix addresses the issue.


Thanks for the feedback and the test case. I wonder if ALTER SUBSCRIPTION
DISABLE/ENABLE is useful in the test case?


Turns out it's not necessary.  Attached is an updated patch that
simplifies the test even further and moves it into the
008_diff_schema.pl file.


OK. No further comments on my side.


Committed and backpatched.  Thanks!

--
Peter Eisentraut  http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services




Re: logical replication - negative bitmapset member not allowed

2019-11-09 Thread Jehan-Guillaume de Rorthais
On Sat, 9 Nov 2019 09:18:21 +0100
Peter Eisentraut  wrote:

> On 2019-11-07 16:18, Jehan-Guillaume de Rorthais wrote:
> > On Thu, 7 Nov 2019 16:02:21 +0100
> > Peter Eisentraut  wrote:
> >   
> >> On 2019-11-05 17:05, Jehan-Guillaume de Rorthais wrote:  
>  I have simplified your reproduction steps from the previous message to a
>  test case, and I can confirm that your proposed fix addresses the
>  issue.  
> >>>
> >>> Thanks for the feedback and the test case. I wonder if ALTER SUBSCRIPTION
> >>> DISABLE/ENABLE is useful in the test case?  
> >>
> >> Turns out it's not necessary.  Attached is an updated patch that
> >> simplifies the test even further and moves it into the
> >> 008_diff_schema.pl file.  
> > 
> > OK. No further comments on my side.  
> 
> Committed and backpatched.  Thanks!

I'm glad to help!

Thanks,




Re: type SERIAL in C host-struct

2019-11-09 Thread Peter J. Holzer
On 2019-11-07 20:14:47 +0100, Matthias Apitz wrote:
> At the end of the day we came up with the following solution:
> 
> strcpy(host_struct.name, "Sigrid");
> EXEC SQL select nextval('lina_lid_seq') into :host_struct.ser;
> 
> EXEC SQL INSERT INTO lina VALUES ( :host_struct );
> 
> which seems to work fine. Any comments about side effects?

You are performing two queries instead of one, so you have to wait for
one extra round trip. Not a problem if client and server are on the same
network or you insert a few host_structs per second. May be a problem if
client and server are in different datacenters and you want to do
hundreds of inserts per second.

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: type SERIAL in C host-struct

2019-11-09 Thread Matthias Apitz
El día sábado, noviembre 09, 2019 a las 04:31:53p. m. +0100, Peter J. Holzer 
escribió:

> On 2019-11-07 20:14:47 +0100, Matthias Apitz wrote:
> > At the end of the day we came up with the following solution:
> > 
> > strcpy(host_struct.name, "Sigrid");
> > EXEC SQL select nextval('lina_lid_seq') into :host_struct.ser;
> > 
> > EXEC SQL INSERT INTO lina VALUES ( :host_struct );
> > 
> > which seems to work fine. Any comments about side effects?
> 
> You are performing two queries instead of one, so you have to wait for
> one extra round trip. Not a problem if client and server are on the same
> network or you insert a few host_structs per second. May be a problem if
> client and server are in different datacenters and you want to do
> hundreds of inserts per second.

Thanks for the feedback. Client and server run both on the same Linux
host. I found also the debug log of ESQL/C i.e. how to enable it with

ECPGdebug(int on, FILE *stream);

The resulting log is really fine for debugging our code:

[26301]: ECPGdebug: set to 1
[26301]: ECPGconnect: opening database newsisis on localhost port 5432  for 
user sisis
[26301]: prepare_common on line 49: name s_statename; query: "SELECT myint, 
mychar, mydate, myvchar, myblob FROM mytypes;"
[26301]: ecpg_execute on line 52: query: declare c_statename cursor for SELECT 
myint, mychar, mydate, myvchar, myblob FROM mytypes;; with 0 parameter(s) on 
connection newsisis
[26301]: ecpg_execute on line 52: using PQexec
[26301]: ecpg_process_output on line 52: OK: DECLARE CURSOR
[26301]: ecpg_execute on line 60: query: fetch in c_statename; with 0 
parameter(s) on connection newsisis
[26301]: ecpg_execute on line 60: using PQexec
[26301]: ecpg_process_output on line 60: correctly got 1 tuples with 5 fields
[26301]: ecpg_get_data on line 60: RESULT: 1 offset: 4; array: no
[26301]: ecpg_get_data on line 60: RESULT: char offset: 8; array: no
[26301]: ecpg_get_data on line 60: RESULT: 08.05.1945 offset: 8; array: no
[26301]: ecpg_get_data on line 60: RESULT: освобождение offset: 81; array: no
...

What is missing are timestamps in enough precision. I will add this to
the code in postgresql-11.4/src/interfaces/ecpg/ecpglib/misc.c where the
implementation of ecpg_log() is.

Thanks

matthias

-- 
Matthias Apitz, ✉ g...@unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub

"Glaube wenig, hinterfrage alles, denke selbst: Wie man Manipulationen 
durchschaut"
"Believe little, scrutinise all, think by your own: How see through 
manipulations"
ISBN-10: 386489218X