Skip to content

Instantly share code, notes, and snippets.

SELECT table,
formatReadableSize(sum(bytes)) as size,
min(min_date) as min_date,
max(max_date) as max_date
FROM system.parts
WHERE active
GROUP BY table
@oniestel
oniestel / import_tsv_to_dockerized_postgres.sh
Created October 18, 2018 15:48
Import *.tsv file to dockerized postgres from host
#!/bin/bash
cat <file>.tsv | docker exec -i <container> psql -d <database> -U user -c "COPY <table> FROM STDIN"