Postgresql – Tipps and Tricks

Using PLSQL for setting Grants:

 

CREATE OR REPLACE FUNCTION set_all_sq_grants() RETURNS SETOF TEXT AS
$BODY$
DECLARE
r record;
BEGIN
FOR r IN
SELECT sequence_name, sequence_schema FROM information_schema.sequences WHERE sequence_schema = 'xxx'
LOOP
-- can do some processing here
EXECUTE ' Grant all on ' || r.sequence_schema || '.' || r.sequence_name || ' to userXY' ;
--RETURN NEXT r; -- return current row of SELECT
END LOOP;
RETURN;
END
$BODY$
LANGUAGE plpgsql;

— und ausführen
select xxx.set_all_sq_grants();

more about Postgres PLSQL: Fun with Functions.

 

 

Text to UML and others

Was searching for tools for documentation, doing graphics out of Text:

Very good summary link: Text to UML.

Most features: Planttext

Clean and easy, Sequence and FlowChart: http://chartmage.com/index.html

Also very fast to use: http://www.nomnoml.com

And one for ERM: https://app.quickdatabasediagrams.com

One more https://start.jhipster.tech/jdl-studio/