Обсуждение: Remove one last occurrence of "replication slave" in comments

Поиск
Список
Период
Сортировка

Remove one last occurrence of "replication slave" in comments

От
Daniel Gustafsson
Дата:
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

[1] https://twitter.com/Xof/status/1141040942645776384


Вложения

Re: Remove one last occurrence of "replication slave" in comments

От
Magnus Hagander
Дата:
On Wed, Jun 19, 2019 at 2:35 PM Daniel Gustafsson <daniel@yesql.se> wrote:
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.

Applied, thanks.
 
--

Re: Remove one last occurrence of "replication slave" in comments

От
ilmari@ilmari.org (Dagfinn Ilmari Mannsåker)
Дата:
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


Re: Remove one last occurrence of "replication slave" in comments

От
Peter Eisentraut
Дата:
On 2019-06-19 19:04, Dagfinn Ilmari Mannsåker wrote:
> There were some more master/slave references in the plpgsql foreign key
> tests, which the attached chages to base/leaf instead.

base/leaf doesn't sound like a good pair.  I committed it with root/leaf
instead.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



Re: Remove one last occurrence of "replication slave" in comments

От
ilmari@ilmari.org (Dagfinn Ilmari Mannsåker)
Дата:
Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:

> On 2019-06-19 19:04, Dagfinn Ilmari Mannsåker wrote:
>> There were some more master/slave references in the plpgsql foreign key
>> tests, which the attached chages to base/leaf instead.
>
> base/leaf doesn't sound like a good pair.  I committed it with root/leaf
> instead.

Thanks!  You're right, that is a better name pair.

- ilmari
-- 
"A disappointingly low fraction of the human race is,
 at any given time, on fire." - Stig Sandbeck Mathisen