DROP VIEW megaview;
DROP TABLE megatab;

CREATE TABLE megatab (
    A_adbin             text,
    A_adnum             int2,
    A_adrelid           oid,
    A_adsrc             text,
    A_aggbasetype       oid,
    A_aggfinalfn        regproc,
    A_aggfinaltype      oid,
    A_agginitval1       text,
    A_agginitval2       text,
    A_aggname           name,
    A_aggowner          int4,
    A_aggtransfn1       regproc,
    A_aggtransfn2       regproc,
    A_aggtranstype1     oid,
    A_aggtranstype2     oid,
    A_ambeginscan       regproc,
    A_ambuild           regproc,
    A_amclose           regproc,
    A_amcostestimate    regproc,
    A_amcreate          regproc,
    A_amdelete          regproc,
    A_amdestroy         regproc,
    A_amendscan         regproc,
    A_amfreetuple       regproc,
    A_amgetattr         regproc,
    A_amgettuple        regproc,
    A_amid              oid,
    A_aminsert          regproc,
    A_ammarkpos         regproc,
    A_amname            name,
    A_amopclaid         oid,
    A_amopen            regproc,
    A_amopid            oid,
    A_amopopr           oid,
    A_amopstrategy      int2,
    A_amorderstrategy   int2,
    A_amowner           int4,
    A_amprocnum         int2,
    A_amproc            oid,
    A_amrescan          regproc,
    A_amrestrpos        regproc,
    A_amsetlock         regproc,
    A_amsettid          regproc,
    A_amstrategies      int2,
    A_amsupport         int2,
    A_attalign          char,
    A_attbyval          bool,
    A_attcacheoff       int4,
    A_attdisbursion     float4,
    A_atthasdef         bool,
    A_attisset          bool,
    A_attlen            int2,
    A_attname           name,
    A_attnelems         int4,
    A_attnotnull        bool,
    A_attnum            int2,
    A_attrelid          oid,
    A_attstorage        char,
    A_atttypid          oid,
    A_atttypmod         int4,
    A_chunk_data        bytea,
    A_chunk_id          oid,
    A_chunk_seq         int4,
    A_datdba            int4,
    A_datname           name,
    A_datpath           text,
    A_definition        text,
    A_description       text,
    A_encoding          int4,
    A_ev_action         lztext,
    A_ev_attr           int2,
    A_ev_class          oid,
    A_ev_qual           lztext,
    A_ev_type           char,
    A_grolist           _int4,
    A_groname           name,
    A_grosysid          int4,
    A_hasindexes        bool,
    A_hasrules          bool,
    A_hastriggers       bool,
    A_indclass          oidvector,
    A_indexdef          text,
    A_indexname         name,
    A_indexrelid        oid,
    A_indhaskeytype     bool,
    A_indisclustered    bool,
    A_indislossy        bool,
    A_indisprimary      bool,
    A_indisunique       bool,
    A_indkey            int2vector,
    A_indpred           text,
    A_indproc           oid,
    A_indreference      oid,
    A_indrelid          oid,
    A_inhargrelid       oid,
    A_inhdefrelid       oid,
    A_inhparent         oid,
    A_inhproc           oid,
    A_inhproname        name,
    A_inhrelid          oid,
    A_inhseqno          int4,
    A_iplipl            oid,
    A_iplrelid          oid,
    A_iplseqno          int4,
    A_is_instead        bool,
    A_lancompiler       text,
    A_lanispl           bool,
    A_lanname           name,
    A_lanplcallfoid     oid,
    A_lanpltrusted      bool,
    A_listenerpid       int4,
    A_logfoo            oid,
    A_notification      int4,
    A_objoid            oid,
    A_opcdeftype        oid,
    A_opcname           name,
    A_oprcanhash        bool,
    A_oprcode           regproc,
    A_oprcom            oid,
    A_oprisleft         bool,
    A_oprjoin           regproc,
    A_oprkind           char,
    A_oprleft           oid,
    A_oprlsortop        oid,
    A_oprname           name,
    A_oprnegate         oid,
    A_oprowner          int4,
    A_oprprec           int2,
    A_oprrest           regproc,
    A_oprresult         oid,
    A_oprright          oid,
    A_oprrsortop        oid,
    A_passwd            text,
    A_proargtypes       oidvector,
    A_probin            bytea,
    A_probyte_pct       int4,
    A_proiscachable     bool,
    A_proisinh          bool,
    A_proisstrict       bool,
    A_proistrusted      bool,
    A_prolang           oid,
    A_proname           name,
    A_pronargs          int2,
    A_prooutin_ratio    int4,
    A_proowner          int4,
    A_properbyte_cpu    int4,
    A_propercall_cpu    int4,
    A_proretset         bool,
    A_prorettype        oid,
    A_prosrc            text,
    A_rcbin             text,
    A_rcname            name,
    A_rcrelid           oid,
    A_rcsrc             text,
    A_relacl            _aclitem,
    A_relam             oid,
    A_relchecks         int2,
    A_relfkeys          int2,
    A_relhasindex       bool,
    A_relhaspkey        bool,
    A_relhasrules       bool,
    A_relhassubclass    bool,
    A_relisshared       bool,
    A_relkind           char,
    A_relname           name,
    A_relnatts          int2,
    A_relowner          int4,
    A_relpages          int4,
    A_relrefs           int2,
    A_reltoastidxid     oid,
    A_reltoastrelid     oid,
    A_reltriggers       int2,
    A_reltuples         int4,
    A_reltype           oid,
    A_relukeys          int2,
    A_rulename          name,
    A_staattnum         int2,
    A_stacommonfrac     float4,
    A_stacommonval      text,
    A_stahival          text,
    A_staloval          text,
    A_stanullfrac       float4,
    A_staop             oid,
    A_starelid          oid,
    A_tablename         name,
    A_tableowner        name,
    A_tgargs            bytea,
    A_tgattr            int2vector,
    A_tgconstrname      name,
    A_tgconstrrelid     oid,
    A_tgdeferrable      bool,
    A_tgenabled         bool,
    A_tgfoid            oid,
    A_tginitdeferred    bool,
    A_tgisconstraint    bool,
    A_tgname            name,
    A_tgnargs           int2,
    A_tgrelid           oid,
    A_tgtype            int2,
    A_typalign          char,
    A_typbyval          bool,
    A_typdefault        text,
    A_typdelim          char,
    A_typelem           oid,
    A_typinput          regproc,
    A_typisdefined      bool,
    A_typlen            int2,
    A_typname           name,
    A_typoutput         regproc,
    A_typowner          int4,
    A_typprtlen         int2,
    A_typreceive        regproc,
    A_typrelid          oid,
    A_typsend           regproc,
    A_typstorage        char,
    A_typtype           char,
    A_usecatupd         bool,
    A_usecreatedb       bool,
    A_usename           name,
    A_usesuper          bool,
    A_usesysid          int4,
    A_usetrace          bool,
    A_valuntil          abstime,
    A_varfoo            oid,
    A_viewname          name,
    A_viewowner         name,
    A_xactlockfoo       oid,
    B_adbin             text,
    B_adnum             int2,
    B_adrelid           oid,
    B_adsrc             text,
    B_aggbasetype       oid,
    B_aggfinalfn        regproc,
    B_aggfinaltype      oid,
    B_agginitval1       text,
    B_agginitval2       text,
    B_aggname           name,
    B_aggowner          int4,
    B_aggtransfn1       regproc,
    B_aggtransfn2       regproc,
    B_aggtranstype1     oid,
    B_aggtranstype2     oid,
    B_ambeginscan       regproc,
    B_ambuild           regproc,
    B_amclose           regproc,
    B_amcostestimate    regproc,
    B_amcreate          regproc,
    B_amdelete          regproc,
    B_amdestroy         regproc,
    B_amendscan         regproc,
    B_amfreetuple       regproc,
    B_amgetattr         regproc,
    B_amgettuple        regproc,
    B_amid              oid,
    B_aminsert          regproc,
    B_ammarkpos         regproc,
    B_amname            name,
    B_amopclaid         oid,
    B_amopen            regproc,
    B_amopid            oid,
    B_amopopr           oid,
    B_amopstrategy      int2,
    B_amorderstrategy   int2,
    B_amowner           int4,
    B_amprocnum         int2,
    B_amproc            oid,
    B_amrescan          regproc,
    B_amrestrpos        regproc,
    B_amsetlock         regproc,
    B_amsettid          regproc,
    B_amstrategies      int2,
    B_amsupport         int2,
    B_attalign          char,
    B_attbyval          bool,
    B_attcacheoff       int4,
    B_attdisbursion     float4,
    B_atthasdef         bool,
    B_attisset          bool,
    B_attlen            int2,
    B_attname           name,
    B_attnelems         int4,
    B_attnotnull        bool,
    B_attnum            int2,
    B_attrelid          oid,
    B_attstorage        char,
    B_atttypid          oid,
    B_atttypmod         int4,
    B_chunk_data        bytea,
    B_chunk_id          oid,
    B_chunk_seq         int4,
    B_datdba            int4,
    B_datname           name,
    B_datpath           text,
    B_definition        text,
    B_description       text,
    B_encoding          int4,
    B_ev_action         lztext,
    B_ev_attr           int2,
    B_ev_class          oid,
    B_ev_qual           lztext,
    B_ev_type           char,
    B_grolist           _int4,
    B_groname           name,
    B_grosysid          int4,
    B_hasindexes        bool,
    B_hasrules          bool,
    B_hastriggers       bool,
    B_indclass          oidvector,
    B_indexdef          text,
    B_indexname         name,
    B_indexrelid        oid,
    B_indhaskeytype     bool,
    B_indisclustered    bool,
    B_indislossy        bool,
    B_indisprimary      bool,
    B_indisunique       bool,
    B_indkey            int2vector,
    B_indpred           text,
    B_indproc           oid,
    B_indreference      oid,
    B_indrelid          oid,
    B_inhargrelid       oid,
    B_inhdefrelid       oid,
    B_inhparent         oid,
    B_inhproc           oid,
    B_inhproname        name,
    B_inhrelid          oid,
    B_inhseqno          int4,
    B_iplipl            oid,
    B_iplrelid          oid,
    B_iplseqno          int4,
    B_is_instead        bool,
    B_lancompiler       text,
    B_lanispl           bool,
    B_lanname           name,
    B_lanplcallfoid     oid,
    B_lanpltrusted      bool,
    B_listenerpid       int4,
    B_logfoo            oid,
    B_notification      int4,
    B_objoid            oid,
    B_opcdeftype        oid,
    B_opcname           name,
    B_oprcanhash        bool,
    B_oprcode           regproc,
    B_oprcom            oid,
    B_oprisleft         bool,
    B_oprjoin           regproc,
    B_oprkind           char,
    B_oprleft           oid,
    B_oprlsortop        oid,
    B_oprname           name,
    B_oprnegate         oid,
    B_oprowner          int4,
    B_oprprec           int2,
    B_oprrest           regproc,
    B_oprresult         oid,
    B_oprright          oid,
    B_oprrsortop        oid,
    B_passwd            text,
    B_proargtypes       oidvector,
    B_probin            bytea,
    B_probyte_pct       int4,
    B_proiscachable     bool,
    B_proisinh          bool,
    B_proisstrict       bool,
    B_proistrusted      bool,
    B_prolang           oid,
    B_proname           name,
    B_pronargs          int2,
    B_prooutin_ratio    int4,
    B_proowner          int4,
    B_properbyte_cpu    int4,
    B_propercall_cpu    int4,
    B_proretset         bool,
    B_prorettype        oid,
    B_prosrc            text,
    B_rcbin             text,
    B_rcname            name,
    B_rcrelid           oid,
    B_rcsrc             text,
    B_relacl            _aclitem,
    B_relam             oid,
    B_relchecks         int2,
    B_relfkeys          int2,
    B_relhasindex       bool,
    B_relhaspkey        bool,
    B_relhasrules       bool,
    B_relhassubclass    bool,
    B_relisshared       bool,
    B_relkind           char,
    B_relname           name,
    B_relnatts          int2,
    B_relowner          int4,
    B_relpages          int4,
    B_relrefs           int2,
    B_reltoastidxid     oid,
    B_reltoastrelid     oid,
    B_reltriggers       int2,
    B_reltuples         int4,
    B_reltype           oid,
    B_relukeys          int2,
    B_rulename          name,
    B_staattnum         int2,
    B_stacommonfrac     float4,
    B_stacommonval      text,
    B_stahival          text,
    B_staloval          text,
    B_stanullfrac       float4,
    B_staop             oid,
    B_starelid          oid,
    B_tablename         name,
    B_tableowner        name,
    B_tgargs            bytea,
    B_tgattr            int2vector,
    B_tgconstrname      name,
    B_tgconstrrelid     oid,
    B_tgdeferrable      bool,
    B_tgenabled         bool,
    B_tgfoid            oid,
    B_tginitdeferred    bool,
    B_tgisconstraint    bool,
    B_tgname            name,
    B_tgnargs           int2,
    B_tgrelid           oid,
    B_tgtype            int2,
    B_typalign          char,
    B_typbyval          bool,
    B_typdefault        text,
    B_typdelim          char,
    B_typelem           oid,
    B_typinput          regproc,
    B_typisdefined      bool,
    B_typlen            int2,
    B_typname           name,
    B_typoutput         regproc,
    B_typowner          int4,
    B_typprtlen         int2,
    B_typreceive        regproc,
    B_typrelid          oid,
    B_typsend           regproc,
    B_typstorage        char,
    B_typtype           char,
    B_usecatupd         bool,
    B_usecreatedb       bool,
    B_usename           name,
    B_usesuper          bool,
    B_usesysid          int4,
    B_usetrace          bool,
    B_valuntil          abstime,
    B_varfoo            oid,
    B_viewname          name,
    B_viewowner         name,
    B_xactlockfoo       oid,
    C_adbin             text,
    C_adnum             int2,
    C_adrelid           oid,
    C_adsrc             text,
    C_aggbasetype       oid,
    C_aggfinalfn        regproc,
    C_aggfinaltype      oid,
    C_agginitval1       text,
    C_agginitval2       text,
    C_aggname           name,
    C_aggowner          int4,
    C_aggtransfn1       regproc,
    C_aggtransfn2       regproc,
    C_aggtranstype1     oid,
    C_aggtranstype2     oid,
    C_ambeginscan       regproc,
    C_ambuild           regproc,
    C_amclose           regproc,
    C_amcostestimate    regproc,
    C_amcreate          regproc,
    C_amdelete          regproc,
    C_amdestroy         regproc,
    C_amendscan         regproc,
    C_amfreetuple       regproc,
    C_amgetattr         regproc,
    C_amgettuple        regproc,
    C_amid              oid,
    C_aminsert          regproc,
    C_ammarkpos         regproc,
    C_amname            name,
    C_amopclaid         oid,
    C_amopen            regproc,
    C_amopid            oid,
    C_amopopr           oid,
    C_amopstrategy      int2,
    C_amorderstrategy   int2,
    C_amowner           int4,
    C_amprocnum         int2,
    C_amproc            oid,
    C_amrescan          regproc,
    C_amrestrpos        regproc,
    C_amsetlock         regproc,
    C_amsettid          regproc,
    C_amstrategies      int2,
    C_amsupport         int2,
    C_attalign          char,
    C_attbyval          bool,
    C_attcacheoff       int4,
    C_attdisbursion     float4,
    C_atthasdef         bool,
    C_attisset          bool,
    C_attlen            int2,
    C_attname           name,
    C_attnelems         int4,
    C_attnotnull        bool,
    C_attnum            int2,
    C_attrelid          oid,
    C_attstorage        char,
    C_atttypid          oid,
    C_atttypmod         int4,
    C_chunk_data        bytea,
    C_chunk_id          oid,
    C_chunk_seq         int4,
    C_datdba            int4,
    C_datname           name,
    C_datpath           text,
    C_definition        text,
    C_description       text,
    C_encoding          int4,
    C_ev_action         lztext,
    C_ev_attr           int2,
    C_ev_class          oid,
    C_ev_qual           lztext,
    C_ev_type           char,
    C_grolist           _int4,
    C_groname           name,
    C_grosysid          int4,
    C_hasindexes        bool,
    C_hasrules          bool,
    C_hastriggers       bool,
    C_indclass          oidvector,
    C_indexdef          text,
    C_indexname         name,
    C_indexrelid        oid,
    C_indhaskeytype     bool,
    C_indisclustered    bool,
    C_indislossy        bool,
    C_indisprimary      bool,
    C_indisunique       bool,
    C_indkey            int2vector,
    C_indpred           text,
    C_indproc           oid,
    C_indreference      oid,
    C_indrelid          oid,
    C_inhargrelid       oid,
    C_inhdefrelid       oid,
    C_inhparent         oid,
    C_inhproc           oid,
    C_inhproname        name,
    C_inhrelid          oid,
    C_inhseqno          int4,
    C_iplipl            oid,
    C_iplrelid          oid,
    C_iplseqno          int4,
    C_is_instead        bool,
    C_lancompiler       text,
    C_lanispl           bool,
    C_lanname           name,
    C_lanplcallfoid     oid,
    C_lanpltrusted      bool,
    C_listenerpid       int4,
    C_logfoo            oid,
    C_notification      int4,
    C_objoid            oid,
    C_opcdeftype        oid,
    C_opcname           name,
    C_oprcanhash        bool,
    C_oprcode           regproc,
    C_oprcom            oid,
    C_oprisleft         bool,
    C_oprjoin           regproc,
    C_oprkind           char,
    C_oprleft           oid,
    C_oprlsortop        oid,
    C_oprname           name,
    C_oprnegate         oid,
    C_oprowner          int4,
    C_oprprec           int2,
    C_oprrest           regproc,
    C_oprresult         oid,
    C_oprright          oid,
    C_oprrsortop        oid,
    C_passwd            text,
    C_proargtypes       oidvector,
    C_probin            bytea,
    C_probyte_pct       int4,
    C_proiscachable     bool,
    C_proisinh          bool,
    C_proisstrict       bool,
    C_proistrusted      bool,
    C_prolang           oid,
    C_proname           name,
    C_pronargs          int2,
    C_prooutin_ratio    int4,
    C_proowner          int4,
    C_properbyte_cpu    int4,
    C_propercall_cpu    int4,
    C_proretset         bool,
    C_prorettype        oid,
    C_prosrc            text,
    C_rcbin             text,
    C_rcname            name,
    C_rcrelid           oid,
    C_rcsrc             text,
    C_relacl            _aclitem,
    C_relam             oid,
    C_relchecks         int2,
    C_relfkeys          int2,
    C_relhasindex       bool,
    C_relhaspkey        bool,
    C_relhasrules       bool,
    C_relhassubclass    bool,
    C_relisshared       bool,
    C_relkind           char,
    C_relname           name,
    C_relnatts          int2,
    C_relowner          int4,
    C_relpages          int4,
    C_relrefs           int2,
    C_reltoastidxid     oid,
    C_reltoastrelid     oid,
    C_reltriggers       int2,
    C_reltuples         int4,
    C_reltype           oid,
    C_relukeys          int2,
    C_rulename          name,
    C_staattnum         int2,
    C_stacommonfrac     float4,
    C_stacommonval      text,
    C_stahival          text,
    C_staloval          text,
    C_stanullfrac       float4,
    C_staop             oid,
    C_starelid          oid,
    C_tablename         name,
    C_tableowner        name,
    C_tgargs            bytea,
    C_tgattr            int2vector,
    C_tgconstrname      name,
    C_tgconstrrelid     oid,
    C_tgdeferrable      bool,
    C_tgenabled         bool,
    C_tgfoid            oid,
    C_tginitdeferred    bool,
    C_tgisconstraint    bool,
    C_tgname            name,
    C_tgnargs           int2,
    C_tgrelid           oid,
    C_tgtype            int2,
    C_typalign          char,
    C_typbyval          bool,
    C_typdefault        text,
    C_typdelim          char,
    C_typelem           oid,
    C_typinput          regproc,
    C_typisdefined      bool,
    C_typlen            int2,
    C_typname           name,
    C_typoutput         regproc,
    C_typowner          int4,
    C_typprtlen         int2,
    C_typreceive        regproc,
    C_typrelid          oid,
    C_typsend           regproc,
    C_typstorage        char,
    C_typtype           char,
    C_usecatupd         bool,
    C_usecreatedb       bool,
    C_usename           name,
    C_usesuper          bool,
    C_usesysid          int4,
    C_usetrace          bool,
    C_valuntil          abstime,
    C_varfoo            oid,
    C_viewname          name,
    C_viewowner         name,
    C_xactlockfoo       oid
);

CREATE VIEW megaview AS SELECT * FROM megatab;
