Skip to content

Commit 3064044

Browse files
authored
Follow up to #216 (fixed in 007ee2f). Fixes additional test failures (#259)
where the current username must be quoted as an identifier.
1 parent fc78be3 commit 3064044

File tree

4 files changed

+59
-59
lines changed

4 files changed

+59
-59
lines changed

test/sql/ownership.sql

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ SELECT * FROM check_test(
7171
db_owner_is(current_database(), current_user),
7272
true,
7373
'db_owner_is(db, user)',
74-
'Database ' || quote_ident(current_database()) || ' should be owned by ' || current_user,
74+
'Database ' || quote_ident(current_database()) || ' should be owned by ' || quote_ident(current_user),
7575
''
7676
);
7777

@@ -141,7 +141,7 @@ SELECT * FROM check_test(
141141
relation_owner_is('public', 'sometab', current_user),
142142
true,
143143
'relation_owner_is(sch, tab, user)',
144-
'Relation public.sometab should be owned by ' || current_user,
144+
'Relation public.sometab should be owned by ' || quote_ident(current_user),
145145
''
146146
);
147147

@@ -173,7 +173,7 @@ SELECT * FROM check_test(
173173
relation_owner_is('sometab', current_user),
174174
true,
175175
'relation_owner_is(tab, user)',
176-
'Relation sometab should be owned by ' || current_user,
176+
'Relation sometab should be owned by ' || quote_ident(current_user),
177177
''
178178
);
179179

@@ -199,7 +199,7 @@ SELECT * FROM check_test(
199199
relation_owner_is('public', 'apart', current_user),
200200
true,
201201
'relation_owner_is(sch, part, user)',
202-
'Relation public.apart should be owned by ' || current_user,
202+
'Relation public.apart should be owned by ' || quote_ident(current_user),
203203
''
204204
);
205205

@@ -231,7 +231,7 @@ SELECT * FROM check_test(
231231
relation_owner_is('apart', current_user),
232232
true,
233233
'relation_owner_is(part, user)',
234-
'Relation apart should be owned by ' || current_user,
234+
'Relation apart should be owned by ' || quote_ident(current_user),
235235
''
236236
);
237237

@@ -257,7 +257,7 @@ SELECT * FROM check_test(
257257
relation_owner_is('public', 'someseq', current_user),
258258
true,
259259
'relation_owner_is(sch, seq, user)',
260-
'Relation public.someseq should be owned by ' || current_user,
260+
'Relation public.someseq should be owned by ' || quote_ident(current_user),
261261
''
262262
);
263263

@@ -289,7 +289,7 @@ SELECT * FROM check_test(
289289
relation_owner_is('someseq', current_user),
290290
true,
291291
'relation_owner_is(seq, user)',
292-
'Relation someseq should be owned by ' || current_user,
292+
'Relation someseq should be owned by ' || quote_ident(current_user),
293293
''
294294
);
295295

@@ -315,7 +315,7 @@ SELECT * FROM check_test(
315315
table_owner_is('public', 'sometab', current_user),
316316
true,
317317
'table_owner_is(sch, tab, user)',
318-
'Table public.sometab should be owned by ' || current_user,
318+
'Table public.sometab should be owned by ' || quote_ident(current_user),
319319
''
320320
);
321321

@@ -347,7 +347,7 @@ SELECT * FROM check_test(
347347
table_owner_is('sometab', current_user),
348348
true,
349349
'table_owner_is(tab, user)',
350-
'Table sometab should be owned by ' || current_user,
350+
'Table sometab should be owned by ' || quote_ident(current_user),
351351
''
352352
);
353353

@@ -407,7 +407,7 @@ SELECT * FROM check_test(
407407
view_owner_is('public', 'someview', current_user),
408408
true,
409409
'view_owner_is(sch, view, user)',
410-
'View public.someview should be owned by ' || current_user,
410+
'View public.someview should be owned by ' || quote_ident(current_user),
411411
''
412412
);
413413

@@ -439,7 +439,7 @@ SELECT * FROM check_test(
439439
view_owner_is('someview', current_user),
440440
true,
441441
'view_owner_is(view, user)',
442-
'View someview should be owned by ' || current_user,
442+
'View someview should be owned by ' || quote_ident(current_user),
443443
''
444444
);
445445

@@ -482,7 +482,7 @@ SELECT * FROM check_test(
482482
sequence_owner_is('public', 'someseq', current_user),
483483
true,
484484
'sequence_owner_is(sch, sequence, user)',
485-
'Sequence public.someseq should be owned by ' || current_user,
485+
'Sequence public.someseq should be owned by ' || quote_ident(current_user),
486486
''
487487
);
488488

@@ -514,7 +514,7 @@ SELECT * FROM check_test(
514514
sequence_owner_is('someseq', current_user),
515515
true,
516516
'sequence_owner_is(sequence, user)',
517-
'Sequence someseq should be owned by ' || current_user,
517+
'Sequence someseq should be owned by ' || quote_ident(current_user),
518518
''
519519
);
520520

@@ -557,7 +557,7 @@ SELECT * FROM check_test(
557557
composite_owner_is('public', 'sometype', current_user),
558558
true,
559559
'composite_owner_is(sch, composite, user)',
560-
'Composite type public.sometype should be owned by ' || current_user,
560+
'Composite type public.sometype should be owned by ' || quote_ident(current_user),
561561
''
562562
);
563563

@@ -589,7 +589,7 @@ SELECT * FROM check_test(
589589
composite_owner_is('sometype', current_user),
590590
true,
591591
'composite_owner_is(composite, user)',
592-
'Composite type sometype should be owned by ' || current_user,
592+
'Composite type sometype should be owned by ' || quote_ident(current_user),
593593
''
594594
);
595595

@@ -643,7 +643,7 @@ BEGIN
643643
foreign_table_owner_is('public', 'my_fdw', current_user),
644644
true,
645645
'foreign_table_owner_is(sch, tab, user)',
646-
'Foreign table public.my_fdw should be owned by ' || current_user,
646+
'Foreign table public.my_fdw should be owned by ' || quote_ident(current_user),
647647
''
648648
) AS b LOOP RETURN NEXT tap.b; END LOOP;
649649

@@ -675,7 +675,7 @@ BEGIN
675675
foreign_table_owner_is('my_fdw', current_user),
676676
true,
677677
'foreign_table_owner_is(tab, user)',
678-
'Foreign table my_fdw should be owned by ' || current_user,
678+
'Foreign table my_fdw should be owned by ' || quote_ident(current_user),
679679
''
680680
) AS b LOOP RETURN NEXT tap.b; END LOOP;
681681

@@ -798,7 +798,7 @@ SELECT * FROM check_test(
798798
function_owner_is('public', 'somefunction', ARRAY['integer'], current_user),
799799
true,
800800
'function_owner_is(sch, function, args[integer], user)',
801-
'Function public.somefunction(integer) should be owned by ' || current_user,
801+
'Function public.somefunction(integer) should be owned by ' || quote_ident(current_user),
802802
''
803803
);
804804

@@ -814,7 +814,7 @@ SELECT * FROM check_test(
814814
function_owner_is('public', 'test_fdw', '{}'::NAME[], current_user),
815815
true,
816816
'function_owner_is(sch, function, args[], user)',
817-
'Function public.test_fdw() should be owned by ' || current_user,
817+
'Function public.test_fdw() should be owned by ' || quote_ident(current_user),
818818
''
819819
);
820820

@@ -830,7 +830,7 @@ SELECT * FROM check_test(
830830
function_owner_is('somefunction', ARRAY['integer'], current_user),
831831
true,
832832
'function_owner_is(function, args[integer], user)',
833-
'Function somefunction(integer) should be owned by ' || current_user,
833+
'Function somefunction(integer) should be owned by ' || quote_ident(current_user),
834834
''
835835
);
836836

@@ -846,7 +846,7 @@ SELECT * FROM check_test(
846846
function_owner_is('test_fdw', '{}'::NAME[], current_user),
847847
true,
848848
'function_owner_is(function, args[], user)',
849-
'Function test_fdw() should be owned by ' || current_user,
849+
'Function test_fdw() should be owned by ' || quote_ident(current_user),
850850
''
851851
);
852852

@@ -942,7 +942,7 @@ SELECT * FROM check_test(
942942
index_owner_is('someschema', 'anothertab', 'idx_name', current_user),
943943
true,
944944
'index_owner_is(schema, table, index, user)',
945-
'Index idx_name ON someschema.anothertab should be owned by ' || current_user,
945+
'Index idx_name ON someschema.anothertab should be owned by ' || quote_ident(current_user),
946946
''
947947
);
948948

@@ -999,7 +999,7 @@ SELECT * FROM check_test(
999999
index_owner_is('sometab', 'idx_hey', current_user),
10001000
true,
10011001
'index_owner_is(table, index, user)',
1002-
'Index idx_hey ON sometab should be owned by ' || current_user,
1002+
'Index idx_hey ON sometab should be owned by ' || quote_ident(current_user),
10031003
''
10041004
);
10051005

@@ -1213,7 +1213,7 @@ SELECT * FROM check_test(
12131213
type_owner_is('someschema', 'us_postal_code', current_user),
12141214
true,
12151215
'type_owner_is(schema, type, user)',
1216-
'Type someschema.us_postal_code should be owned by ' || current_user,
1216+
'Type someschema.us_postal_code should be owned by ' || quote_ident(current_user),
12171217
''
12181218
);
12191219

@@ -1262,7 +1262,7 @@ SELECT * FROM check_test(
12621262
type_owner_is('sometype', current_user),
12631263
true,
12641264
'type_owner_is(type, user)',
1265-
'Type sometype should be owned by ' || current_user,
1265+
'Type sometype should be owned by ' || quote_ident(current_user),
12661266
''
12671267
);
12681268

@@ -1308,7 +1308,7 @@ BEGIN
13081308
materialized_view_owner_is('public', 'somemview', current_user),
13091309
true,
13101310
'materialized_view_owner_is(sch, materialized_view, user)',
1311-
'Materialized view public.somemview should be owned by ' || current_user,
1311+
'Materialized view public.somemview should be owned by ' || quote_ident(current_user),
13121312
''
13131313
) AS b LOOP
13141314
RETURN NEXT tap.b;
@@ -1348,7 +1348,7 @@ BEGIN
13481348
materialized_view_owner_is('somemview', current_user),
13491349
true,
13501350
'materialized_view_owner_is(view, user)',
1351-
'Materialized view somemview should be owned by ' || current_user,
1351+
'Materialized view somemview should be owned by ' || quote_ident(current_user),
13521352
''
13531353
) AS b LOOP
13541354
RETURN NEXT tap.b;
@@ -1400,7 +1400,7 @@ BEGIN
14001400
view_owner_is('public', 'someview', current_user),
14011401
true,
14021402
'materialized_view_owner_is(sch, materialized_view, user)',
1403-
'View public.someview should be owned by ' || current_user,
1403+
'View public.someview should be owned by ' || quote_ident(current_user),
14041404
''
14051405
) AS b LOOP
14061406
RETURN NEXT tap.b;
@@ -1440,7 +1440,7 @@ BEGIN
14401440
view_owner_is('someview', current_user),
14411441
true,
14421442
'materialized_view_owner_is(view, user)',
1443-
'View someview should be owned by ' || current_user,
1443+
'View someview should be owned by ' || quote_ident(current_user),
14441444
''
14451445
) AS b LOOP
14461446
RETURN NEXT tap.b;

0 commit comments

Comments
 (0)