Monday, December 12, 2022

postgreSQL: how to copy (duplicate) a row with binary data

 

>PROBLEM

You need to duplicate a table's row copying from a previous one that contains decode binary data that we shal avoid using copy/paste.


>SOLUTION

Notice that in this example, prtkey and pubkey are binary fields using bytea type.

The uptime is a timestamptz not null field.

 

INSERT INTO keysvc (id,title,pvtkey,pubkey,status,uptime) VALUES( 2, 'ramnode4',null ,null ,1, CURRENT_TIMESTAMP);  

with keys as (SELECT pvtkey, pubkey, uptime FROM keysvc where id = 1)
update keysvc set pvtkey=(select pvtkey from keys), pubkey=(select pubkey from keys), uptime=(select uptime from keys) where id =40;

NOTE: this solution was also published by myself at this date on 
There you'll find another alternative.

>ENV

PostgreSQL


Thursday, December 8, 2022

angular: [webpack-dev-server] Disconnected! polyfills.js:1 [webpack-dev-server] Trying to reconnect...

  

>PROBLEM


When you access the Angular app, the browser's console returns the following message, that keeps repeating:

[webpack-dev-server] Disconnected!
polyfills.js:1 [webpack-dev-server] Trying to reconnect...


>SOLUTION


When starting the Angular app using the "--host" flag, it may also require the "--disable-host-check" flag.

It usually happens when using docker, and it is required the "--host" flag to enable access to the app.


Notice that, when you start the service using just the "host" flag, you get this advice:


  Warning: This is a simple server for use in testing or debugging Angular applications

  locally. It hasn't been reviewed for security issues.

  Binding this server to an open connection can result in compromising your application or

  computer. Using a different host than the one passed to the "--host" flag might result in

  websocket connection issues. You might need to use "--disable-host-check" if that's the

  case.

  


>ENV

Angular CLI: 14.2.9

Node: 16.13.1

Package Manager: npm 8.5.4

OS: win32 x64

debian/docker




[MYREF]:
y;faq-angular [webpack-dev-server] Disconnected! polyfills.js:1 [webpack-dev-server] Trying to reconnect...<memo<angularx;.

eclipse: java: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder" or Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder

  >PROBLEM Using Eclipse, you try to run a simple logging test using "org.slf4j.Logger" like the sample below: package Test; im...