Skip to content

Commit dec21e6

Browse files
fix schema cache errors
1 parent 9f5bbb2 commit dec21e6

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

crates/pg_schema_cache/src/queries/tables.sql

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ select
55
c.relrowsecurity as rls_enabled,
66
c.relforcerowsecurity as rls_forced,
77
case
8-
when c.relreplident = 'd' then 'default'
9-
when c.relreplident = 'i' then 'index'
10-
when c.relreplident = 'f' then 'full'
11-
else 'nothing'
8+
when c.relreplident = 'd' then 'DEFAULT'
9+
when c.relreplident = 'i' then 'INDEX'
10+
when c.relreplident = 'f' then 'FULL'
11+
else 'NOTHING'
1212
end as "replica_identity!",
13-
pg_total_relation_size(format('%i.%i', nc.nspname, c.relname)) :: int8 as "bytes!",
13+
pg_total_relation_size(format('%I.%I', nc.nspname, c.relname)) :: int8 as "bytes!",
1414
pg_size_pretty(
15-
pg_total_relation_size(format('%i.%i', nc.nspname, c.relname))
15+
pg_total_relation_size(format('%I.%I', nc.nspname, c.relname))
1616
) as "size!",
1717
pg_stat_get_live_tuples(c.oid) as "live_rows_estimate!",
1818
pg_stat_get_dead_tuples(c.oid) as "dead_rows_estimate!",
@@ -24,12 +24,12 @@ where
2424
c.relkind in ('r', 'p')
2525
and not pg_is_other_temp_schema(nc.oid)
2626
and (
27-
pg_has_role(c.relowner, 'usage')
27+
pg_has_role(c.relowner, 'USAGE')
2828
or has_table_privilege(
2929
c.oid,
30-
'select, insert, update, delete, truncate, references, trigger'
30+
'SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER'
3131
)
32-
or has_any_column_privilege(c.oid, 'select, insert, update, references')
32+
or has_any_column_privilege(c.oid, 'SELECT, INSERT, UPDATE, REFERENCES')
3333
)
3434
group by
3535
c.oid,

0 commit comments

Comments
 (0)