Re: Remove one last occurrence of "replication slave" in comments - Mailing list pgsql-hackers

From ilmari@ilmari.org (Dagfinn Ilmari Mannsåker)
Subject Re: Remove one last occurrence of "replication slave" in comments
Date
Msg-id d8jzhmdwlpg.fsf@dalvik.ping.uio.no
Whole thread Raw
In response to Remove one last occurrence of "replication slave" in comments  (Daniel Gustafsson <daniel@yesql.se>)
Responses Re: Remove one last occurrence of "replication slave" in comments
List pgsql-hackers
Daniel Gustafsson <daniel@yesql.se> writes:

> A Twitter thread today regarding the use of master/slave [1] made me curious
> and so I had a look.  It seems that commit a1ef920e27ba6ab3602aaf6d6751d8628
> replaced most instances but missed at least one which is fixed in the attached.
>
> cheers ./daniel

There were some more master/slave references in the plpgsql foreign key
tests, which the attached chages to base/leaf instead.

I didn't touch the last mention of "slave", in the pltcl code, because
it's calling the Tcl_CreateSlave() API function.

- ilmari
-- 
"The surreality of the universe tends towards a maximum" -- Skud's Law
"Never formulate a law or axiom that you're not prepared to live with
 the consequences of."                              -- Skud's Meta-Law


From 4b9f6cd9e019e61118e38caad452caf2ec23af35 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= <ilmari@ilmari.org>
Date: Wed, 19 Jun 2019 17:59:19 +0100
Subject: [PATCH] Remove master/slave usage from plpgsql tests

---
 src/pl/plpgsql/src/expected/plpgsql_trap.out | 24 ++++++++++----------
 src/pl/plpgsql/src/sql/plpgsql_trap.sql      | 12 +++++-----
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/src/pl/plpgsql/src/expected/plpgsql_trap.out b/src/pl/plpgsql/src/expected/plpgsql_trap.out
index 881603f5c4..bb8f065bc0 100644
--- a/src/pl/plpgsql/src/expected/plpgsql_trap.out
+++ b/src/pl/plpgsql/src/expected/plpgsql_trap.out
@@ -186,17 +186,17 @@ NOTICE:  should see this only if -100 fits in smallint
 --
 -- test foreign key error trapping
 --
-create temp table master(f1 int primary key);
-create temp table slave(f1 int references master deferrable);
-insert into master values(1);
-insert into slave values(1);
-insert into slave values(2);    -- fails
-ERROR:  insert or update on table "slave" violates foreign key constraint "slave_f1_fkey"
-DETAIL:  Key (f1)=(2) is not present in table "master".
+create temp table base(f1 int primary key);
+create temp table leaf(f1 int references base deferrable);
+insert into base values(1);
+insert into leaf values(1);
+insert into leaf values(2);    -- fails
+ERROR:  insert or update on table "leaf" violates foreign key constraint "leaf_f1_fkey"
+DETAIL:  Key (f1)=(2) is not present in table "base".
 create function trap_foreign_key(int) returns int as $$
 begin
     begin    -- start a subtransaction
-        insert into slave values($1);
+        insert into leaf values($1);
     exception
         when foreign_key_violation then
             raise notice 'caught foreign_key_violation';
@@ -238,8 +238,8 @@ begin;
 
   savepoint x;
     set constraints all immediate; -- fails
-ERROR:  insert or update on table "slave" violates foreign key constraint "slave_f1_fkey"
-DETAIL:  Key (f1)=(2) is not present in table "master".
+ERROR:  insert or update on table "leaf" violates foreign key constraint "leaf_f1_fkey"
+DETAIL:  Key (f1)=(2) is not present in table "base".
   rollback to x;
   select trap_foreign_key_2();  -- detects FK violation
 NOTICE:  caught foreign_key_violation
@@ -249,7 +249,7 @@ NOTICE:  caught foreign_key_violation
 (1 row)
 
 commit;                -- still fails
-ERROR:  insert or update on table "slave" violates foreign key constraint "slave_f1_fkey"
-DETAIL:  Key (f1)=(2) is not present in table "master".
+ERROR:  insert or update on table "leaf" violates foreign key constraint "leaf_f1_fkey"
+DETAIL:  Key (f1)=(2) is not present in table "base".
 drop function trap_foreign_key(int);
 drop function trap_foreign_key_2();
diff --git a/src/pl/plpgsql/src/sql/plpgsql_trap.sql b/src/pl/plpgsql/src/sql/plpgsql_trap.sql
index 7e75f46934..b658cb1888 100644
--- a/src/pl/plpgsql/src/sql/plpgsql_trap.sql
+++ b/src/pl/plpgsql/src/sql/plpgsql_trap.sql
@@ -127,18 +127,18 @@ select test_variable_storage();
 -- test foreign key error trapping
 --
 
-create temp table master(f1 int primary key);
+create temp table base(f1 int primary key);
 
-create temp table slave(f1 int references master deferrable);
+create temp table leaf(f1 int references base deferrable);
 
-insert into master values(1);
-insert into slave values(1);
-insert into slave values(2);    -- fails
+insert into base values(1);
+insert into leaf values(1);
+insert into leaf values(2);    -- fails
 
 create function trap_foreign_key(int) returns int as $$
 begin
     begin    -- start a subtransaction
-        insert into slave values($1);
+        insert into leaf values($1);
     exception
         when foreign_key_violation then
             raise notice 'caught foreign_key_violation';
-- 
2.20.1


pgsql-hackers by date:

Previous
From: Thom Brown
Date:
Subject: Re: SQL/JSON path issues/questions
Next
From: Pavel Stehule
Date:
Subject: Re: idea: log_statement_sample_rate - bottom limit for sampling