Wednesday, March 22, 2023

Postgres SQL - AWS Connect

 To disable encryption

  1. File --> Options and settings --> Data source settings
  2. Click Edit Permissions on your connection
  3. Uncheck Encrypt Connections
==================================================

Power Query:
let
    Source = Value.NativeQuery(PostgreSQL.Database("database.XPTO.com.br", "DBName", [CreateNavigationProperties=false]),
"select#(lf)  table_name,#(lf)  pg_size_pretty(pg_relation_size(quote_ident(table_name))),#(lf)  pg_relation_size(quote_ident(table_name))#(lf)from information_schema.tables#(lf)where table_schema = 'public'#(lf)order by 3 desc", null, [EnableFolding=true])
in
    Source


=============================
select
  table_name,
  pg_size_pretty(pg_relation_size(quote_ident(table_name))),
  pg_relation_size(quote_ident(table_name))
from information_schema.tables
where table_schema = 'public'
order by 3 desc;

select table_schema, table_name, pg_relation_size('"'||table_schema||'"."'||table_name||'"')
from information_schema.tables
order by 3

No comments:

Post a Comment

Power BI APP - Delete or Unpublish

 UNPUBLISH DELETE