@@ -8,7 +8,7 @@ schemas_with_privilege(oid, name) as (
8
8
-- irreleavnt tenants
9
9
-- https://github.com/supabase/pg_graphql/pull/480
10
10
select
11
- pn .oid ::int ,
11
+ pn .oid ::bigint ,
12
12
pn .nspname ::text
13
13
from
14
14
pg_namespace pn
45
45
select
46
46
pt .oid ,
47
47
jsonb_build_object(
48
- ' oid' , pt .oid ::int ,
49
- ' schema_oid' , min (pt .typnamespace )::int ,
48
+ ' oid' , pt .oid ::bigint ,
49
+ ' schema_oid' , min (pt .typnamespace )::bigint ,
50
50
' name' , min (pt .typname ),
51
51
' comment' , pg_catalog .obj_description (pt .oid , ' pg_type' ),
52
52
' directives' , jsonb_build_object(
55
55
),
56
56
' values' , jsonb_agg(
57
57
jsonb_build_object(
58
- ' oid' , pe .oid ::int ,
58
+ ' oid' , pe .oid ::bigint ,
59
59
' name' , pe .enumlabel ,
60
60
' sort_order' , (pe .enumsortorder * 100000 )::int
61
61
)
@@ -85,10 +85,10 @@ select
85
85
(
86
86
select
87
87
jsonb_object_agg(
88
- pt .oid ::int ,
88
+ pt .oid ::bigint ,
89
89
jsonb_build_object(
90
- ' oid' , pt .oid ::int ,
91
- ' schema_oid' , pt .typnamespace ::int ,
90
+ ' oid' , pt .oid ::bigint ,
91
+ ' schema_oid' , pt .typnamespace ::bigint ,
92
92
' name' , pt .typname ,
93
93
' category' , case
94
94
when pt .typcategory = ' A' then ' Array'
99
99
else ' Other'
100
100
end,
101
101
-- if category is 'Array', points at the underlying element type
102
- ' array_element_type_oid' , nullif(pt .typelem ::int , 0 ),
102
+ ' array_element_type_oid' , nullif(pt .typelem ::bigint , 0 ),
103
103
-- if category is 'Table' points to the table oid
104
- ' table_oid' , tabs .oid ::int ,
104
+ ' table_oid' , tabs .oid ::bigint ,
105
105
' comment' , pg_catalog .obj_description (pt .oid , ' pg_type' ),
106
106
' permissions' , jsonb_build_object(
107
107
' is_usable' , pg_catalog .has_type_privilege (current_user , pt .oid , ' USAGE' )
@@ -122,8 +122,8 @@ select
122
122
select
123
123
jsonb_agg(
124
124
jsonb_build_object(
125
- ' oid' , pt .oid ::int ,
126
- ' schema_oid' , pt .typnamespace ::int
125
+ ' oid' , pt .oid ::bigint ,
126
+ ' schema_oid' , pt .typnamespace ::bigint
127
127
)
128
128
)
129
129
from
@@ -146,7 +146,7 @@ select
146
146
jsonb_agg(
147
147
jsonb_build_object(
148
148
' local_table_meta' , jsonb_build_object(
149
- ' oid' , pf .conrelid ::int ,
149
+ ' oid' , pf .conrelid ::bigint ,
150
150
' name' , pa_local .relname ::text ,
151
151
' is_rls_enabled' , pa_local .relrowsecurity ,
152
152
' schema' , pa_local .relnamespace ::regnamespace::text ,
@@ -162,7 +162,7 @@ select
162
162
)
163
163
),
164
164
' referenced_table_meta' , jsonb_build_object(
165
- ' oid' , pf .confrelid ::int ,
165
+ ' oid' , pf .confrelid ::bigint ,
166
166
' name' , pa_referenced .relname ::text ,
167
167
' is_rls_enabled' , pa_referenced .relrowsecurity ,
168
168
' schema' , pa_referenced .relnamespace ::regnamespace::text ,
@@ -202,9 +202,9 @@ select
202
202
(
203
203
select
204
204
jsonb_object_agg(
205
- pn .oid ::int ,
205
+ pn .oid ::bigint ,
206
206
jsonb_build_object(
207
- ' oid' , pn .oid ::int ,
207
+ ' oid' , pn .oid ::bigint ,
208
208
' name' , pn .name ,
209
209
' comment' , pg_catalog .obj_description (pn .oid , ' pg_namespace' ),
210
210
' directives' , jsonb_build_object(
@@ -230,15 +230,15 @@ select
230
230
(
231
231
select
232
232
jsonb_object_agg(
233
- pc .oid ::int ,
233
+ pc .oid ::bigint ,
234
234
jsonb_build_object(
235
- ' oid' , pc .oid ::int ,
235
+ ' oid' , pc .oid ::bigint ,
236
236
' name' , pc .relname ::text ,
237
237
' relkind' , pc .relkind ::text ,
238
- ' reltype' , pc .reltype ::int ,
238
+ ' reltype' , pc .reltype ::bigint ,
239
239
' is_rls_enabled' , pc .relrowsecurity ,
240
240
' schema' , schemas_ .name ,
241
- ' schema_oid' , pc .relnamespace ::int ,
241
+ ' schema_oid' , pc .relnamespace ::bigint ,
242
242
' comment' , pg_catalog .obj_description (pc .oid , ' pg_class' ),
243
243
' directives' , (
244
244
with directives(directive) as (
@@ -267,7 +267,7 @@ select
267
267
select
268
268
jsonb_agg(
269
269
jsonb_build_object(
270
- ' table_oid' , pi .indrelid ::int ,
270
+ ' table_oid' , pi .indrelid ::bigint ,
271
271
' column_names' , coalesce(
272
272
(
273
273
select
@@ -296,13 +296,13 @@ select
296
296
jsonb_agg(
297
297
jsonb_build_object(
298
298
' name' , pa .attname ::text ,
299
- ' type_oid' , pa .atttypid ::int ,
299
+ ' type_oid' , pa .atttypid ::bigint ,
300
300
-- includes type mod info like char(4)
301
301
' type_name' , pg_catalog .format_type (pa .atttypid , pa .atttypmod ),
302
302
-- char, bpchar, varchar, char[], bpchar[], carchar[]
303
303
-- the -4 removes the byte for the null terminated str
304
304
' max_characters' , nullif(pa .atttypmod , - 1 ) - 4 ,
305
- ' schema_oid' , schemas_ .oid ::int ,
305
+ ' schema_oid' , schemas_ .oid ::bigint ,
306
306
' is_not_null' , pa .attnotnull ,
307
307
' attribute_num' , pa .attnum ,
308
308
' has_default' , pd .adbin is not null , -- pg_get_expr(pd.adbin, pd.adrelid) shows expression
@@ -397,13 +397,13 @@ select
397
397
select
398
398
jsonb_agg(
399
399
jsonb_build_object(
400
- ' oid' , pp .oid ::int ,
400
+ ' oid' , pp .oid ::bigint ,
401
401
' name' , pp .proname ::text ,
402
- ' type_oid' , pp .prorettype ::oid :: int ,
402
+ ' type_oid' , pp .prorettype ::bigint ,
403
403
' type_name' , pp .prorettype ::regtype::text ,
404
- ' schema_oid' , pronamespace::int ,
404
+ ' schema_oid' , pronamespace::bigint ,
405
405
' schema_name' , pronamespace::regnamespace::text ,
406
- ' arg_types' , proargtypes::int [],
406
+ ' arg_types' , proargtypes::bigint [],
407
407
' arg_names' , proargnames::text [],
408
408
' arg_defaults' , pg_get_expr(proargdefaults, 0 )::text ,
409
409
' num_args' , pronargs,
0 commit comments