Tuesday, February 28, 2017
Tuesday, February 14, 2017
PostgreSQL: size of a relation
Relation w/o inheritance:
Relation w/ inheritance:
select pg_size_pretty(pg_total_relation_size('radius_db.radacct'));
Relation w/ inheritance:
select pg_size_pretty(sum(pg_total_relation_size(inhrelid))::bigint + pg_total_relation_size('ods_db.radius_cdr_pdp')) from pg_inherits where inhparent='ods_db.radius_cdr_pdp'::regclass;
Labels:
postgresql
Monday, February 6, 2017
PostgreSQL: detect duplicates
Detect duplicates in at_file after a given date:
select * from monitor_db.at_file where exists ( select 'x' from monitor_db.at_file i where i.file_id = at_file.file_id and i.process_id = at_file.process_id and i.ctid > at_file.ctid and log_date > '2017-01-31' )
Labels:
postgresql
Wednesday, February 1, 2017
Linux: Run script as user without login shell
Source : http://serverfault.com/questions/351046/run-script-as-user-who-has-nologin-shell
su -s /bin/bash -c '/tmp/site.pl' apache
Subscribe to:
Posts (Atom)