Changeset: acc986d5e60d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=acc986d5e60d
Modified Files:
        sql/test/emptydb/Tests/check.stable.out
        sql/test/emptydb/Tests/check.stable.out.int128
Branch: monetdbe-proxy
Log Message:

Approve check test.


diffs (truncated from 3094 to 300 lines):

diff --git a/sql/test/emptydb/Tests/check.stable.out 
b/sql/test/emptydb/Tests/check.stable.out
--- a/sql/test/emptydb/Tests/check.stable.out
+++ b/sql/test/emptydb/Tests/check.stable.out
@@ -23,6 +23,7 @@
 \dSt sys.db_user_info
 \dSt sys.dependencies
 \dSt sys.dependency_types
+\dSt sys.dump_statements
 \dSt sys.function_languages
 \dSt sys.function_types
 \dSt sys.functions
@@ -85,7 +86,38 @@
 \dSv sys.dependency_views_on_functions
 \dSv sys.dependency_views_on_procedures
 \dSv sys.dependency_views_on_views
+\dSv sys.describe_column_defaults
+\dSv sys.describe_comments
+\dSv sys.describe_constraints
+\dSv sys.describe_foreign_keys
+\dSv sys.describe_functions
+\dSv sys.describe_indices
+\dSv sys.describe_partition_tables
+\dSv sys.describe_privileges
+\dSv sys.describe_sequences
+\dSv sys.describe_tables
+\dSv sys.describe_triggers
+\dSv sys.describe_user_defined_types
+\dSv sys.dump_add_schemas_to_users
+\dSv sys.dump_column_defaults
+\dSv sys.dump_comments
+\dSv sys.dump_create_roles
+\dSv sys.dump_create_schemas
+\dSv sys.dump_create_users
+\dSv sys.dump_foreign_keys
+\dSv sys.dump_functions
+\dSv sys.dump_grant_user_priviledges
+\dSv sys.dump_indices
+\dSv sys.dump_partition_tables
+\dSv sys.dump_privileges
+\dSv sys.dump_sequences
+\dSv sys.dump_start_sequences
+\dSv sys.dump_table_constraint_type
+\dSv sys.dump_tables
+\dSv sys.dump_triggers
+\dSv sys.dump_user_defined_types
 \dSv sys.environment
+\dSv sys.fully_qualified_functions
 \dSv sys.geometry_columns
 \dSv sys.ids
 \dSv sys.optimizers
@@ -108,8 +140,10 @@
 \dSv sys.tracelog
 \dSv sys.users
 \dSv sys.var_values
+\dSf sys."_dump_table_data"
 \dSf sys."abbrev"
 \dSf sys."alpha"
+\dSf sys."alter_table"
 \dSf sys."analyze"
 \dSf sys."bbp"
 \dSf sys."broadcast"
@@ -120,6 +154,7 @@
 \dSf sys."covar_pop"
 \dSf sys."covar_samp"
 \dSf sys."createorderindex"
+\dSf sys."current_size_dump_statements"
 \dSf sys."date_to_str"
 \dSf sys."date_trunc"
 \dSf sys."db_users"
@@ -130,16 +165,24 @@
 \dSf sys."describe_function"
 \dSf sys."describe_table"
 \dSf sys."describe_type"
+\dSf sys."dq"
 \dSf sys."droporderindex"
+\dSf sys."dump_database"
+\dSf sys."dump_table_data"
 \dSf sys."env"
 \dSf sys."epoch"
+\dSf sys."esc"
+\dSf sys."eval"
 \dSf sys."evalalgebra"
 \dSf sys."fitsattach"
 \dSf sys."fitsload"
 \dSf sys."flush_log"
+\dSf sys."fqn"
 \dSf sys."fuse"
 \dSf sys."generate_series"
 \dSf sys."geometrytype"
+\dSf sys."get_merge_table_partition_expressions"
+\dSf sys."get_remote_table_expressions"
 \dSf sys."get_type"
 \dSf sys."getanchor"
 \dSf sys."getbasename"
@@ -189,6 +232,7 @@
 \dSf sys."optimizers"
 \dSf sys."password_hash"
 \dSf sys."pause"
+\dSf sys."prepare_esc"
 \dSf sys."prepared_statements"
 \dSf sys."prepared_statements_args"
 \dSf sys."quantile"
@@ -203,12 +247,14 @@
 \dSf sys."queue"
 \dSf sys."rejects"
 \dSf sys."remote_table_credentials"
+\dSf sys."replace_first"
 \dSf sys."resume"
 \dSf sys."resume_log_flushing"
 \dSf sys."reuse"
 \dSf sys."reverse"
 \dSf sys."right_shift"
 \dSf sys."right_shift_assign"
+\dSf sys."schema_guard"
 \dSf sys."sessions"
 \dSf sys."setmasklen"
 \dSf sys."setmemorylimit"
@@ -223,6 +269,7 @@
 \dSf sys."shpload"
 \dSf sys."shrink"
 \dSf sys."shutdown"
+\dSf sys."sq"
 \dSf sys."st_area"
 \dSf sys."st_asbinary"
 \dSf sys."st_asewkt"
@@ -351,6 +398,7 @@ SYSTEM TABLE  sys.comments
 SYSTEM TABLE  sys.db_user_info
 SYSTEM TABLE  sys.dependencies
 SYSTEM TABLE  sys.dependency_types
+SYSTEM TABLE  sys.dump_statements
 SYSTEM TABLE  sys.function_languages
 SYSTEM TABLE  sys.function_types
 SYSTEM TABLE  sys.functions
@@ -406,7 +454,38 @@ SYSTEM VIEW  sys.dependency_tables_on_vi
 SYSTEM VIEW  sys.dependency_views_on_functions
 SYSTEM VIEW  sys.dependency_views_on_procedures
 SYSTEM VIEW  sys.dependency_views_on_views
+SYSTEM VIEW  sys.describe_column_defaults
+SYSTEM VIEW  sys.describe_comments
+SYSTEM VIEW  sys.describe_constraints
+SYSTEM VIEW  sys.describe_foreign_keys
+SYSTEM VIEW  sys.describe_functions
+SYSTEM VIEW  sys.describe_indices
+SYSTEM VIEW  sys.describe_partition_tables
+SYSTEM VIEW  sys.describe_privileges
+SYSTEM VIEW  sys.describe_sequences
+SYSTEM VIEW  sys.describe_tables
+SYSTEM VIEW  sys.describe_triggers
+SYSTEM VIEW  sys.describe_user_defined_types
+SYSTEM VIEW  sys.dump_add_schemas_to_users
+SYSTEM VIEW  sys.dump_column_defaults
+SYSTEM VIEW  sys.dump_comments
+SYSTEM VIEW  sys.dump_create_roles
+SYSTEM VIEW  sys.dump_create_schemas
+SYSTEM VIEW  sys.dump_create_users
+SYSTEM VIEW  sys.dump_foreign_keys
+SYSTEM VIEW  sys.dump_functions
+SYSTEM VIEW  sys.dump_grant_user_priviledges
+SYSTEM VIEW  sys.dump_indices
+SYSTEM VIEW  sys.dump_partition_tables
+SYSTEM VIEW  sys.dump_privileges
+SYSTEM VIEW  sys.dump_sequences
+SYSTEM VIEW  sys.dump_start_sequences
+SYSTEM VIEW  sys.dump_table_constraint_type
+SYSTEM VIEW  sys.dump_tables
+SYSTEM VIEW  sys.dump_triggers
+SYSTEM VIEW  sys.dump_user_defined_types
 SYSTEM VIEW  sys.environment
+SYSTEM VIEW  sys.fully_qualified_functions
 SYSTEM VIEW  sys.geometry_columns
 SYSTEM VIEW  sys.ids
 SYSTEM VIEW  sys.optimizers
@@ -435,6 +514,7 @@ SYSTEM FUNCTION         sys.<>
 SYSTEM FUNCTION         sys.=
 SYSTEM FUNCTION         sys.>
 SYSTEM FUNCTION         sys.>=
+SYSTEM PROCEDURE        sys._dump_table_data
 SYSTEM FUNCTION         sys.abbrev
 SYSTEM FUNCTION         sys.abs
 SYSTEM FUNCTION         sys.acos
@@ -442,6 +522,7 @@ SYSTEM AGGREGATE        sys.all
 SYSTEM FUNCTION         sys.all
 SYSTEM AGGREGATE        sys.allnotequal
 SYSTEM FUNCTION         sys.alpha
+SYSTEM FUNCTION         sys.alter_table
 SYSTEM PROCEDURE        sys.analyze
 SYSTEM FUNCTION         sys.and
 SYSTEM FUNCTION         sys.any
@@ -488,6 +569,7 @@ SYSTEM PROCEDURE        sys.createorderi
 SYSTEM WINDOW           sys.cume_dist
 SYSTEM FUNCTION         sys.curdate
 SYSTEM FUNCTION         sys.current_date
+SYSTEM FUNCTION         sys.current_size_dump_statements
 SYSTEM FUNCTION         sys.current_time
 SYSTEM FUNCTION         sys.current_timestamp
 SYSTEM FUNCTION         sys.curtime
@@ -510,12 +592,17 @@ SYSTEM FUNCTION         sys.describe_tab
 SYSTEM FUNCTION         sys.describe_type
 SYSTEM WINDOW           sys.diff
 SYSTEM FUNCTION         sys.difference
+SYSTEM FUNCTION         sys.dq
 SYSTEM PROCEDURE        sys.droporderindex
+SYSTEM FUNCTION         sys.dump_database
+SYSTEM PROCEDURE        sys.dump_table_data
 SYSTEM FUNCTION         sys.editdistance
 SYSTEM FUNCTION         sys.editdistance2
 SYSTEM FUNCTION         sys.env
 SYSTEM FUNCTION         sys.epoch
 SYSTEM FUNCTION         sys.epoch_ms
+SYSTEM FUNCTION         sys.esc
+SYSTEM PROCEDURE        sys.eval
 SYSTEM PROCEDURE        sys.evalalgebra
 SYSTEM AGGREGATE        sys.exist
 SYSTEM FUNCTION         sys.exp
@@ -524,9 +611,12 @@ SYSTEM PROCEDURE        sys.fitsattach
 SYSTEM PROCEDURE        sys.fitsload
 SYSTEM FUNCTION         sys.floor
 SYSTEM PROCEDURE        sys.flush_log
+SYSTEM FUNCTION         sys.fqn
 SYSTEM FUNCTION         sys.fuse
 SYSTEM FUNCTION         sys.generate_series
 SYSTEM FUNCTION         sys.geometrytype
+SYSTEM FUNCTION         sys.get_merge_table_partition_expressions
+SYSTEM FUNCTION         sys.get_remote_table_expressions
 SYSTEM FUNCTION         sys.get_type
 SYSTEM FUNCTION         sys.get_value_for
 SYSTEM FUNCTION         sys.getanchor
@@ -647,6 +737,7 @@ SYSTEM PROCEDURE        sys.pause
 SYSTEM WINDOW           sys.percent_rank
 SYSTEM FUNCTION         sys.pi
 SYSTEM FUNCTION         sys.power
+SYSTEM FUNCTION         sys.prepare_esc
 SYSTEM FUNCTION         sys.prepared_statements
 SYSTEM FUNCTION         sys.prepared_statements_args
 SYSTEM AGGREGATE        sys.prod
@@ -670,6 +761,7 @@ SYSTEM FUNCTION         sys.rejects
 SYSTEM FUNCTION         sys.remote_table_credentials
 SYSTEM FUNCTION         sys.repeat
 SYSTEM FUNCTION         sys.replace
+SYSTEM FUNCTION         sys.replace_first
 SYSTEM FUNCTION         sys.restart
 SYSTEM PROCEDURE        sys.resume
 SYSTEM PROCEDURE        sys.resume_log_flushing
@@ -686,6 +778,7 @@ SYSTEM FUNCTION         sys.rpad
 SYSTEM FUNCTION         sys.rtrim
 SYSTEM FUNCTION         sys.scale_down
 SYSTEM FUNCTION         sys.scale_up
+SYSTEM FUNCTION         sys.schema_guard
 SYSTEM FUNCTION         sys.second
 SYSTEM FUNCTION         sys.sessions
 SYSTEM FUNCTION         sys.setmasklen
@@ -708,6 +801,7 @@ SYSTEM FUNCTION         sys.sinh
 SYSTEM FUNCTION         sys.soundex
 SYSTEM FUNCTION         sys.space
 SYSTEM FUNCTION         sys.splitpart
+SYSTEM FUNCTION         sys.sq
 SYSTEM FUNCTION         sys.sql_add
 SYSTEM FUNCTION         sys.sql_anyequal
 SYSTEM FUNCTION         sys.sql_div
@@ -876,6 +970,7 @@ CREATE TABLE "sys"."comments" ("id" INTE
 CREATE TABLE "sys"."db_user_info" ("name" VARCHAR(1024), "fullname" 
VARCHAR(2048), "default_schema" INTEGER, "schema_path" CHARACTER LARGE OBJECT);
 CREATE TABLE "sys"."dependencies" ("id" INTEGER, "depend_id" INTEGER, 
"depend_type" SMALLINT);
 CREATE TABLE "sys"."dependency_types" ("dependency_type_id" SMALLINT NOT NULL, 
"dependency_type_name" VARCHAR(15) NOT NULL, CONSTRAINT 
"dependency_types_dependency_type_id_pkey" PRIMARY KEY ("dependency_type_id"), 
CONSTRAINT "dependency_types_dependency_type_name_unique" UNIQUE 
("dependency_type_name"));
+CREATE TABLE "sys"."dump_statements" ("o" INTEGER NOT NULL, "s" CHARACTER 
LARGE OBJECT, CONSTRAINT "dump_statements_o_pkey" PRIMARY KEY ("o"));
 CREATE TABLE "sys"."function_languages" ("language_id" SMALLINT NOT NULL, 
"language_name" VARCHAR(20) NOT NULL, "language_keyword" VARCHAR(20), 
CONSTRAINT "function_languages_language_id_pkey" PRIMARY KEY ("language_id"), 
CONSTRAINT "function_languages_language_name_unique" UNIQUE ("language_name"));
 CREATE TABLE "sys"."function_types" ("function_type_id" SMALLINT NOT NULL, 
"function_type_name" VARCHAR(30) NOT NULL, "function_type_keyword" VARCHAR(30) 
NOT NULL, CONSTRAINT "function_types_function_type_id_pkey" PRIMARY KEY 
("function_type_id"), CONSTRAINT "function_types_function_type_name_unique" 
UNIQUE ("function_type_name"));
 CREATE TABLE "sys"."functions" ("id" INTEGER, "name" VARCHAR(256), "func" 
VARCHAR(8196), "mod" VARCHAR(8196), "language" INTEGER, "type" INTEGER, 
"side_effect" BOOLEAN, "varres" BOOLEAN, "vararg" BOOLEAN, "schema_id" INTEGER, 
"system" BOOLEAN, "semantics" BOOLEAN);
@@ -938,7 +1033,65 @@ create view sys.dependency_tables_on_vie
 create view sys.dependency_views_on_functions as select v.schema_id as 
view_schema_id, v.id as view_id, v.name as view_name, f.name as function_name, 
f.type as function_type, dep.depend_type as depend_type from sys.functions as 
f, sys.tables as v, sys.dependencies as dep where v.id = dep.id and f.id = 
dep.depend_id and dep.depend_type = 7 and f.type <> 2 and v.type in (1, 11) 
order by v.name, v.schema_id, f.name, f.id;
 create view sys.dependency_views_on_procedures as select v.schema_id as 
view_schema_id, v.id as view_id, v.name as view_name, p.id as procedure_id, 
p.name as procedure_name, p.type as procedure_type, dep.depend_type as 
depend_type from sys.functions as p, sys.tables as v, sys.dependencies as dep 
where v.id = dep.id and p.id = dep.depend_id and dep.depend_type = 13 and 
p.type = 2 and v.type in (1, 11) order by v.name, v.schema_id, p.name, p.id;
 create view sys.dependency_views_on_views as select v1.schema_id as 
view1_schema_id, v1.id as view1_id, v1.name as view1_name, v2.schema_id as 
view2_schema_id, v2.id as view2_id, v2.name as view2_name, dep.depend_type as 
depend_type from sys.tables as v1, sys.tables as v2, sys.dependencies as dep 
where v1.id = dep.id and v2.id = dep.depend_id and dep.depend_type = 5 and 
v1.type in (1, 11) and v2.type in (1, 11) order by v1.schema_id, v1.name, 
v2.schema_id, v2.name;
+create view sys.describe_column_defaults as select s.name sch, t.name tbl, 
c.name col, c."default" def from schemas s, tables t, columns c where s.id = 
t.schema_id and t.id = c.table_id and s.name <> 'tmp' and not t.system and 
c."default" is not null;
+create view sys.describe_comments as select o.id id, o.tpe tpe, o.nme fqn, 
c.remark rem from (select id, 'SCHEMA', dq(name) from schemas union all select 
t.id, case when ts.table_type_name = 'VIEW' then 'VIEW' else 'TABLE' end, 
fqn(s.name, t.name) from schemas s join tables t on s.id = t.schema_id join 
table_types ts on t.type = ts.table_type_id where not s.name <> 'tmp' union all 
select c.id, 'COLUMN', fqn(s.name, t.name) || '.' || dq(c.name) from 
sys.columns c, sys.tables t, sys.schemas s where c.table_id = t.id and 
t.schema_id = s.id union all select idx.id, 'INDEX', fqn(s.name, idx.name) from 
sys.idxs idx, sys._tables t, sys.schemas s where idx.table_id = t.id and 
t.schema_id = s.id union all select seq.id, 'SEQUENCE', fqn(s.name, seq.name) 
from sys.sequences seq, schemas s where seq.schema_id = s.id union all select 
f.id, ft.function_type_keyword, fqn(s.name, f.name) from functions f, 
function_types ft, schemas s where f.type = ft.function_type_id and f.schema_id 
= s.id) as o(i
 d, tpe, nme) join comments c on c.id = o.id;
+create view sys.describe_constraints as select s.name sch, t.name tbl, kc.name 
col, k.name con, case when k.type = 0 then 'PRIMARY KEY' when k.type = 1 then 
'UNIQUE' end tpe from sys.schemas s, sys._tables t, sys.objects kc, sys.keys k 
where kc.id = k.id and k.table_id = t.id and s.id = t.schema_id and t.system = 
false and k.type in (0, 1) and t.type in (0, 6);
+create view sys.describe_foreign_keys as with action_type (id, act) as (values 
(0, 'NO ACTION'), (1, 'CASCADE'), (2, 'RESTRICT'), (3, 'SET NULL'), (4, 'SET 
DEFAULT')) select fs.name fk_s, fkt.name fk_t, fkkc.name fk_c, fkkc.nr o, 
fkk.name fk, ps.name pk_s, pkt.name pk_t, pkkc.name pk_c, ou.act on_update, 
od.act on_delete from sys._tables fkt, sys.objects fkkc, sys.keys fkk, 
sys._tables pkt, sys.objects pkkc, sys.keys pkk, sys.schemas ps, sys.schemas 
fs, action_type ou, action_type od where fkt.id = fkk.table_id and pkt.id = 
pkk.table_id and fkk.id = fkkc.id and pkk.id = pkkc.id and fkk.rkey = pkk.id 
and fkkc.nr = pkkc.nr and pkt.schema_id = ps.id and fkt.schema_id = fs.id and 
(fkk."action" & 255) = od.id and ((fkk."action" >> 8) & 255) = ou.id order by 
fkk.name, fkkc.nr;
+create view sys.describe_functions as select f.id o, s.name sch, f.name fun, 
f.func def from functions f join schemas s on f.schema_id = s.id where s.name 
<> 'tmp' and not f.system;
+create view sys.describe_indices as with it (id, idx) as (values (0, 'INDEX'), 
(4, 'IMPRINTS INDEX'), (5, 'ORDERED INDEX')) select i.name ind, s.name sch, 
t.name tbl, c.name col, it.idx tpe from sys.idxs as i left join sys.keys as k 
on i.name = k.name, sys.objects as kc, sys._columns as c, sys.schemas s, 
sys._tables as t, it where i.table_id = t.id and i.id = kc.id and kc.name = 
c.name and t.id = c.table_id and t.schema_id = s.id and k.type is null and 
i.type = it.id order by i.name, kc.nr;
+create view sys.describe_partition_tables as select m_sch, m_tbl, p_sch, 
p_tbl, case when p_raw_type is null then 'READ ONLY' when (p_raw_type = 
'VALUES' and pvalues is null) or (p_raw_type = 'RANGE' and minimum is null and 
maximum is null and with_nulls) then 'FOR NULLS' else p_raw_type end as tpe, 
pvalues, minimum, maximum, with_nulls from (with tp("type", table_id) as 
(select case when (table_partitions."type" & 2) = 2 then 'VALUES' else 'RANGE' 
end, table_partitions.table_id from table_partitions), subq(m_tid, p_mid, 
"type", m_sch, m_tbl, p_sch, p_tbl) as (select m_t.id, p_m.id, m_t."type", 
m_s.name, m_t.name, p_s.name, p_m.name from schemas m_s, sys._tables m_t, 
dependencies d, schemas p_s, sys._tables p_m where m_t."type" in (3, 6) and 
m_t.schema_id = m_s.id and m_s.name <> 'tmp' and m_t.system = false and m_t.id 
= d.depend_id and d.id = p_m.id and p_m.schema_id = p_s.id order by m_t.id, 
p_m.id) select subq.m_sch, subq.m_tbl, subq.p_sch, subq.p_tbl, tp."type" as 
p_raw_type, ca
 se when tp."type" = 'VALUES' then (select group_concat(vp.value, ',')from 
value_partitions vp where vp.table_id = subq.p_mid) else null end as pvalues, 
case when tp."type" = 'RANGE' then (select minimum from range_partitions rp 
where rp.table_id = subq.p_mid) else null end as minimum, case when tp."type" = 
'RANGE' then (select maximum from range_partitions rp where rp.table_id = 
subq.p_mid) else null end as maximum, case when tp."type" = 'VALUES' then 
exists(select vp.value from value_partitions vp where vp.table_id = subq.p_mid 
and vp.value is null) else (select rp.with_nulls from range_partitions rp where 
rp.table_id = subq.p_mid) end as with_nulls from subq left outer join tp on 
subq.m_tid = tp.table_id) as tmp_pi;
+create view sys.describe_privileges as select case when o.tpe is null and 
pc.privilege_code_name = 'SELECT' then 'COPY FROM' when o.tpe is null and 
pc.privilege_code_name = 'UPDATE' then 'COPY INTO' else o.nme end o_nme, case 
when o.tpe is not null then o.tpe else 'GLOBAL' end o_tpe, 
pc.privilege_code_name p_nme, a.name a_nme, g.name g_nme, p.grantable grantable 
from privileges p left join (select t.id, s.name || '.' || t.name , 'TABLE' 
from sys.schemas s, sys.tables t where s.id = t.schema_id union all select 
c.id, s.name || '.' || t.name || '.' || c.name, 'COLUMN' from sys.schemas s, 
sys.tables t, sys.columns c where s.id = t.schema_id and t.id = c.table_id 
union all select f.id, f.nme, f.tpe from fully_qualified_functions f) o(id, 
nme, tpe) on o.id = p.obj_id, sys.privilege_codes pc, auths a, auths g where 
p.privileges = pc.privilege_code_id and p.auth_id = a.id and p.grantor = g.id;
+create view sys.describe_sequences as select s.name as sch, seq.name as seq, 
seq."start" s, get_value_for(s.name, seq.name) as rs, seq."minvalue" mi, 
seq."maxvalue" ma, seq."increment" inc, seq."cacheinc" cache, seq."cycle" cycle 
from sys.sequences seq, sys.schemas s where s.id = seq.schema_id and s.name <> 
'tmp' order by s.name, seq.name;
+create view sys.describe_tables as select t.id o, s.name sch, t.name tab, 
ts.table_type_name typ, (select ' (' || group_concat(dq(c.name) || ' ' || 
sys.describe_type(c.type, c.type_digits, c.type_scale) || ifthenelse(c."null" = 
'false', ' NOT NULL', '') , ', ') || ')' from sys._columns c where c.table_id = 
t.id) col, case when ts.table_type_name = 'REMOTE TABLE' then 
get_remote_table_expressions(s.name, t.name) when ts.table_type_name = 'MERGE 
TABLE' then get_merge_table_partition_expressions(t.id) when ts.table_type_name 
= 'VIEW' then schema_guard(s.name, t.name, t.query) else '' end opt from 
sys.schemas s, table_types ts, sys.tables t where ts.table_type_name in 
('TABLE', 'VIEW', 'MERGE TABLE', 'REMOTE TABLE', 'REPLICA TABLE') and t.system 
= false and s.id = t.schema_id and ts.table_type_id = t.type and s.name <> 
'tmp';
+create view sys.describe_triggers as select s.name sch, t.name tab, tr.name 
tri, tr.statement def from sys.schemas s, sys.tables t, sys.triggers tr where 
s.id = t.schema_id and t.id = tr.table_id and not t.system;
+create view sys.describe_user_defined_types as select s.name sch, t.sqlname 
sql_tpe, t.systemname ext_tpe from sys.types t join sys.schemas s on 
t.schema_id = s.id where t.eclass = 18 and ((s.name = 'sys' and t.sqlname not 
in ('geometrya', 'mbr', 'url', 'inet', 'json', 'uuid', 'xml')) or (s.name <> 
'sys'));
+create view sys.dump_add_schemas_to_users as select 'ALTER USER ' || 
sys.dq(ui.name) || ' SET SCHEMA ' || sys.dq(s.name) || ';' stmt
+from sys.db_user_info ui, sys.schemas s
+where ui.default_schema = s.id
+and ui.name <> 'monetdb'
+and ui.name <> '.snapshot'
+and s.name <> 'sys';
+create view sys.dump_column_defaults as select 'ALTER TABLE ' || fqn(sch, tbl) 
|| ' ALTER COLUMN ' || dq(col) || ' SET DEFAULT ' || def || ';' stmt
+from describe_column_defaults;
+create view sys.dump_comments as select 'COMMENT ON ' || c.tpe || ' ' || c.fqn 
|| ' IS ' || sq(c.rem) || ';' stmt from describe_comments c;
+create view sys.dump_create_roles as select 'CREATE ROLE ' || sys.dq(name) || 
';' stmt from sys.auths
+where name not in (select name from sys.db_user_info)
+and grantor <> 0;
+create view sys.dump_create_schemas as select 'CREATE SCHEMA ' || 
sys.dq(s.name) || ifthenelse(a.name <> 'sysadmin', ' AUTHORIZATION ' || a.name, 
' ') || ';' stmt
+from sys.schemas s, sys.auths a
+where s.authorization = a.id and s.system = false;
+create view sys.dump_create_users as select 'CREATE USER ' || sys.dq(ui.name) 
|| ' WITH ENCRYPTED PASSWORD ' || sys.sq(sys.password_hash(ui.name)) || ' NAME 
' || sys.sq(ui.fullname) || ' SCHEMA sys;' stmt
+from sys.db_user_info ui, sys.schemas s
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to