[ARVADOS] updated: 0017c5ba7d966af1ea3a673f02f0f4102b34ff61

Git user git at public.curoverse.com
Tue Sep 26 15:41:50 EDT 2017


Summary of changes:
 services/api/Rakefile         | 13 +++++++++++--
 services/api/db/structure.sql |  9 ---------
 2 files changed, 11 insertions(+), 11 deletions(-)

       via  0017c5ba7d966af1ea3a673f02f0f4102b34ff61 (commit)
      from  6a544620c4d5acb0c42cd56346f74454637904cb (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 0017c5ba7d966af1ea3a673f02f0f4102b34ff61
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Tue Sep 26 15:39:00 2017 -0400

    12032: Fix compatibility with PostgreSQL 9.4.
    
    9.4 doesn't have idle_in_transaction_session_timeout or row_security
    configs, so couldn't execute structure.sql.
    
    9.4 doesn't write "Dumped from/by version X", so 9.4 and 9.6 dev boxes
    want an edit war.
    
    refs #12032
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>

diff --git a/services/api/Rakefile b/services/api/Rakefile
index fad803c..3de2d27 100644
--- a/services/api/Rakefile
+++ b/services/api/Rakefile
@@ -38,6 +38,7 @@ namespace :db do
       origfnm = File.expand_path('../db/structure.sql', __FILE__)
       tmpfnm = Tempfile.new 'structure.sql', File.expand_path('..', origfnm)
       copyright_done = false
+      started = false
       begin
         tmpfile = File.new tmpfnm, 'w'
         origfile = File.new origfnm
@@ -48,8 +49,16 @@ namespace :db do
             end
             copyright_done = true
           end
-          if /^SET lock_timeout = 0;/ =~ line
-            # Avoid edit wars between versions that do/don't write this line.
+
+          if !started && /^[^-\n]/ !~ line
+            # Ignore the "PostgreSQL database dump" comment block,
+            # which varies from one client version to the next.
+            next
+          end
+          started = true
+
+          if /^SET (lock_timeout|idle_in_transaction_session_timeout|row_security) = / =~ line
+            # Avoid edit wars between versions that do/don't write (and can/can't execute) this line.
             next
           elsif /^COMMENT ON EXTENSION/ =~ line
             # Avoid warning message when loading:
diff --git a/services/api/db/structure.sql b/services/api/db/structure.sql
index d6b74df..2d078f3 100644
--- a/services/api/db/structure.sql
+++ b/services/api/db/structure.sql
@@ -2,20 +2,11 @@
 --
 -- SPDX-License-Identifier: AGPL-3.0
 
---
--- PostgreSQL database dump
---
-
--- Dumped from database version 9.6.4
--- Dumped by pg_dump version 9.6.4
-
 SET statement_timeout = 0;
-SET idle_in_transaction_session_timeout = 0;
 SET client_encoding = 'UTF8';
 SET standard_conforming_strings = on;
 SET check_function_bodies = false;
 SET client_min_messages = warning;
-SET row_security = off;
 
 --
 -- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list