You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: check_postgres.pl
+20-30Lines changed: 20 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -1286,7 +1286,7 @@ package check_postgres;
1286
1286
view=> {
1287
1287
SQL=>q{
1288
1288
SELECT c.*, nspname||'.'||relname AS name, quote_ident(rolname) AS owner,
1289
-
quote_ident(relname) AS safename, quote_ident(nspname) AS schema,
1289
+
quote_ident(relname) AS safename, quote_ident(nspname) AS schemaname,
1290
1290
TRIM(pg_get_viewdef(c.oid, TRUE)) AS viewdef, spcname AS tablespace
1291
1291
FROM pg_class c
1292
1292
JOIN pg_roles r ON (r.oid = c.relowner)
@@ -1298,7 +1298,7 @@ package check_postgres;
1298
1298
table=> {
1299
1299
SQL=>q{
1300
1300
SELECT c.*, nspname||'.'||relname AS name, quote_ident(rolname) AS owner,
1301
-
quote_ident(relname) AS safename, quote_ident(nspname) AS schema,
1301
+
quote_ident(relname) AS safename, quote_ident(nspname) AS schemaname,
1302
1302
spcname AS tablespace
1303
1303
FROM pg_class c
1304
1304
JOIN pg_roles r ON (r.oid = c.relowner)
@@ -1310,7 +1310,7 @@ package check_postgres;
1310
1310
index=> {
1311
1311
SQL=>q{
1312
1312
SELECT c.*, i.*, nspname||'.'||relname AS name, quote_ident(rolname) AS owner,
1313
-
quote_ident(relname) AS safename, quote_ident(nspname) AS schema,
1313
+
quote_ident(relname) AS safename, quote_ident(nspname) AS schemaname,
1314
1314
spcname AS tablespace, amname,
1315
1315
pg_get_indexdef(c.oid) AS indexdef, indrelid::regclass::text AS tablename
1316
1316
FROM pg_class c
@@ -1325,7 +1325,7 @@ package check_postgres;
1325
1325
operator=> {
1326
1326
SQL=>q{
1327
1327
SELECT o.*, o.oid, n.nspname||'.'||o.oprname||' ('||COALESCE(t2.typname,'NONE')||','||COALESCE(t3.typname,'NONE')||')' AS name, quote_ident(o.oprname) AS safename,
1328
-
rolname AS owner, n.nspname AS schema,
1328
+
rolname AS owner, quote_ident(n.nspname) AS schemaname,
1329
1329
t1.typname AS resultname,
1330
1330
t2.typname AS leftname, t3.typname AS rightname,
1331
1331
t4.typname AS resultname,
@@ -1348,7 +1348,8 @@ package check_postgres;
1348
1348
trigger=> {
1349
1349
SQL=>q{
1350
1350
SELECT t.*, n1.nspname||'.'||c1.relname||'.'||t.tgname AS name, quote_ident(t.tgname) AS safename, quote_ident(rolname) AS owner,
1351
-
n1.nspname AS tschema, c1.relname AS tname,
1351
+
quote_ident(n1.nspname) AS schemaname,
1352
+
n1.nspname||'.'||c1.relname AS tablename,
1352
1353
n2.nspname AS cschema, c2.relname AS cname,
1353
1354
n3.nspname AS procschema, p.proname AS procname,
1354
1355
pg_get_triggerdef(t.oid) AS triggerdef,
@@ -1370,7 +1371,7 @@ package check_postgres;
1370
1371
SQL=>q{
1371
1372
SELECT p.*, p.oid, nspname||'.'||p.proname AS name, quote_ident(p.proname) AS safename,
1372
1373
md5(prosrc) AS source_checksum,
1373
-
rolname AS owner, nspname AS schema,
1374
+
rolname AS owner, quote_ident(nspname) AS schemaname,
1374
1375
pg_get_function_arguments(p.oid) AS function_arguments
1375
1376
FROM pg_proc p
1376
1377
JOIN pg_roles r ON (r.oid = p.proowner)
@@ -1380,7 +1381,8 @@ package check_postgres;
1380
1381
constraint=> {
1381
1382
SQL=>q{
1382
1383
SELECT c.*, c.oid, n.nspname||'.'||c1.relname||'.'||c.conname AS name, quote_ident(c.conname) AS safename,
1383
-
n.nspname AS schema, r.relname AS tname,
1384
+
quote_ident(n.nspname) AS schemaname,
1385
+
n.nspname||'.'||r.relname AS tablename,
1384
1386
pg_get_constraintdef(c.oid) AS constraintdef, translate(c.confmatchtype,'u','s') AS confmatchtype_compat
1385
1387
FROM pg_constraint c
1386
1388
JOIN pg_class c1 ON (c1.oid = c.conrelid)
@@ -1392,8 +1394,8 @@ package check_postgres;
1392
1394
column=> {
1393
1395
SQL=>q{
1394
1396
SELECT a.*, n.nspname||'.'||c.relname||'.'||attname AS name, quote_ident(a.attname) AS safename,
1395
-
n.nspname||'.'||c.relname AS tname,
1396
-
typname, quote_ident(nspname) AS schema,
1397
+
n.nspname||'.'||c.relname AS tablename,
1398
+
typname, quote_ident(nspname) AS schemaname,
1397
1399
pg_get_expr(d.adbin, a.attrelid, true) AS default
1398
1400
FROM pg_attribute a
1399
1401
JOIN pg_type t ON (t.oid = a.atttypid)
@@ -7588,30 +7590,18 @@ sub schema_item_exists {
7588
7590
## Skip if the schema does not match (and we have at least one schema, indicating lack of 'noschema')
7589
7591
if ($item_classne'schema') {
7590
7592
my$it = $itemhash->{$db1}{$item_class}{$name};
7591
-
nextifexists$it->{schema} andkeys %{ $itemhash->{$db1}{schema} } and ! exists$itemhash->{$db2}{schema}{ $it->{schema} };
7593
+
nextifexists$it->{schemaname} andkeys %{ $itemhash->{$db1}{schema} } and ! exists$itemhash->{$db2}{schema}{ $it->{schemaname} };
7592
7594
}
7593
-
7594
-
my$one = '1';
7595
-
7596
-
## Special exception for columns: do not add if the table is non-existent
0 commit comments