• Postgres equivalent show create table

    February 27, 2016
    Problem solved ! Here is a pure sql solution, how to get all sql from all tables in Postgres: — — — NB 27.02.16 — List sql tables — show_create_table() — — SELECT ‘CREATE TABLE ‘||sql.table||'(‘ ||array_to_string(array_agg(sql),’, ‘) ||’)’ as sql FROM ( ( SELECT — FIELDS c.oid AS id ,c.relname as table ,9 as […]
  • Copy / clone packages from servers

    February 2, 2016
    If you want to copy or clone packages from one Debian or Ubuntu server to another, here is how to to it: ssh server1 ssh server2 ‘dpkg –get-selections’| dpkg –set-selections apt-get -u dselect-upgrade