News for hackers. Stuff that matters.
Re:Dear Postgres by ape4 on Friday October 13, 2017 @10:37AM (#15466053)
Good thing there is a shortcut :)

Can you do `alter table` on pg_tables?

Re:Dear Postgres by kuschku on Friday October 13, 2017 @10:39AM (#15466073)
pg_tables is a view, which only loads data from a few other internal tables, but you can modify many of them, yes. (And many extensions do that).

Specifically, pg_tables is defined as

    CREATE VIEW pg_tables AS SELECT n.nspname AS schemaname,
        c.relname AS tablename,
        pg_get_userbyid(c.relowner) AS tableowner,
        t.spcname AS tablespace,
        c.relhasindex AS hasindexes,
        c.relhasrules AS hasrules,
        c.relhastriggers AS hastriggers,
        c.relrowsecurity AS rowsecurity
       FROM ((pg_class c
         LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace)))
         LEFT JOIN pg_tablespace t ON ((t.oid = c.reltablespace)))
      WHERE (c.relkind = ANY (ARRAY['r'::"char", 'p'::"char"]));
Re:Dear Postgres by ape4 on Friday October 13, 2017 @10:46AM (#15466143)
Cool. I like the Posgres is written in Postgres. Of course, the normal commands for changing the schema are a better approach.
Re:Dear Postgres by fleetside72 on Friday October 13, 2017 @10:40AM (#15466088)
yes and they are under transactions that your can roll-back, does MySQL do that?