summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Kreen2008-02-28 09:39:44 +0000
committerMarko Kreen2008-02-28 09:39:44 +0000
commit293060a25822dfa33cd5cd7096445b6222636193 (patch)
treef70698928716ced64c3ccdc11b0fda19d3bfce01
parent654c7df4e2ef3484760eaa1bfecbd9c55a1aec97 (diff)
sync upgrade scripts with -stable
-rw-r--r--upgrade/Makefile3
-rw-r--r--upgrade/final/v2.1.5_londiste.sql4
-rw-r--r--upgrade/final/v2.1.5_pgq_core.sql18
-rw-r--r--upgrade/final/v2.1.6_londiste.sql17
-rw-r--r--upgrade/final/v2.1.6_pgq_ext.sql17
-rw-r--r--upgrade/src/v2.1.5_londiste.sql2
-rw-r--r--upgrade/src/v2.1.5_pgq_core.sql2
-rw-r--r--upgrade/src/v2.1.6_londiste.sql6
-rw-r--r--upgrade/src/v2.1.6_pgq_ext.sql6
9 files changed, 62 insertions, 13 deletions
diff --git a/upgrade/Makefile b/upgrade/Makefile
index d9d494c1..b140882f 100644
--- a/upgrade/Makefile
+++ b/upgrade/Makefile
@@ -1,5 +1,6 @@
-SQLS = v2.1.5_londiste.sql v2.1.5_pgq_core.sql v2.1.5_pgq_ext.sql
+#SQLS = v2.1.5_londiste.sql v2.1.5_pgq_core.sql v2.1.5_pgq_ext.sql
+SQLS = v2.1.6_londiste.sql v2.1.6_pgq_ext.sql
SRCS = $(addprefix src/, $(SQLS))
DSTS = $(addprefix final/, $(SQLS))
diff --git a/upgrade/final/v2.1.5_londiste.sql b/upgrade/final/v2.1.5_londiste.sql
index c37b4b52..3b4b31f3 100644
--- a/upgrade/final/v2.1.5_londiste.sql
+++ b/upgrade/final/v2.1.5_londiste.sql
@@ -18,7 +18,7 @@ create table londiste.subscriber_pending_triggers (
primary key (table_name, trigger_name)
);
-drop function londiste.denytrigger();
+-- drop function londiste.denytrigger();
@@ -34,7 +34,7 @@ begin
select n1.nspname || '.' || t1.relname as from_table, n2.nspname || '.' || t2.relname as to_table,
conname::text as fkey_name,
'alter table only ' || quote_ident(n1.nspname) || '.' || quote_ident(t1.relname)
- || ' add constraint ' || quote_ident(fkey.fkey_name) || ' ' || pg_get_constraintdef(c.oid)
+ || ' add constraint ' || quote_ident(conname::text) || ' ' || pg_get_constraintdef(c.oid)
as fkey_def
from pg_constraint c, pg_namespace n1, pg_class t1, pg_namespace n2, pg_class t2
where c.contype = 'f' and (c.conrelid = tbl_oid or c.confrelid = tbl_oid)
diff --git a/upgrade/final/v2.1.5_pgq_core.sql b/upgrade/final/v2.1.5_pgq_core.sql
index 1040ed16..6cffed75 100644
--- a/upgrade/final/v2.1.5_pgq_core.sql
+++ b/upgrade/final/v2.1.5_pgq_core.sql
@@ -1,7 +1,7 @@
begin;
-alter table pgq.subscription constraint subscription_ukey unique (sub_queue, sub_consumer);
+alter table pgq.subscription add constraint subscription_ukey unique (sub_queue, sub_consumer);
create index rq_retry_owner_idx on pgq.retry_queue (ev_owner, ev_id);
@@ -322,8 +322,7 @@ returns setof text as $$
-- List of table names.
-- ----------------------------------------------------------------------
declare
- tbl text;
- scm text;
+ row record;
begin
return next 'pgq.subscription';
return next 'pgq.consumer';
@@ -332,21 +331,24 @@ begin
return next 'pgq.retry_queue';
-- include also txid, pgq_ext and londiste tables if they exist
- for scm, tbl in
- select n.nspname, t.relname from pg_class t, pg_namespace n
+ for row in
+ select n.nspname as scm, t.relname as tbl
+ from pg_class t, pg_namespace n
where n.oid = t.relnamespace
and n.nspname = 'txid' and t.relname = 'epoch'
union all
- select n.nspname, t.relname from pg_class t, pg_namespace n
+ select n.nspname as scm, t.relname as tbl
+ from pg_class t, pg_namespace n
where n.oid = t.relnamespace
and n.nspname = 'londiste' and t.relname = 'completed'
union all
- select n.nspname, t.relname from pg_class t, pg_namespace n
+ select n.nspname as scm, t.relname as tbl
+ from pg_class t, pg_namespace n
where n.oid = t.relnamespace
and n.nspname = 'pgq_ext'
and t.relname in ('completed_tick', 'completed_batch', 'completed_event', 'partial_batch')
loop
- return next scm || '.' || tbl;
+ return next row.scm || '.' || row.tbl;
end loop;
return;
diff --git a/upgrade/final/v2.1.6_londiste.sql b/upgrade/final/v2.1.6_londiste.sql
new file mode 100644
index 00000000..394a964c
--- /dev/null
+++ b/upgrade/final/v2.1.6_londiste.sql
@@ -0,0 +1,17 @@
+
+begin;
+
+
+
+create or replace function londiste.version()
+returns text as $$
+begin
+ return '2.1.6';
+end;
+$$ language plpgsql;
+
+
+
+end;
+
+
diff --git a/upgrade/final/v2.1.6_pgq_ext.sql b/upgrade/final/v2.1.6_pgq_ext.sql
new file mode 100644
index 00000000..cfe2e660
--- /dev/null
+++ b/upgrade/final/v2.1.6_pgq_ext.sql
@@ -0,0 +1,17 @@
+
+begin;
+
+
+
+create or replace function pgq_ext.version()
+returns text as $$
+begin
+ return '2.1.6';
+end;
+$$ language plpgsql;
+
+
+
+end;
+
+
diff --git a/upgrade/src/v2.1.5_londiste.sql b/upgrade/src/v2.1.5_londiste.sql
index 5f641fa3..9933aa1b 100644
--- a/upgrade/src/v2.1.5_londiste.sql
+++ b/upgrade/src/v2.1.5_londiste.sql
@@ -17,7 +17,7 @@ create table londiste.subscriber_pending_triggers (
primary key (table_name, trigger_name)
);
-drop function londiste.denytrigger();
+-- drop function londiste.denytrigger();
\i ../sql/londiste/functions/londiste.find_table_fkeys.sql
\i ../sql/londiste/functions/londiste.find_table_triggers.sql
diff --git a/upgrade/src/v2.1.5_pgq_core.sql b/upgrade/src/v2.1.5_pgq_core.sql
index f2695d7d..8286973e 100644
--- a/upgrade/src/v2.1.5_pgq_core.sql
+++ b/upgrade/src/v2.1.5_pgq_core.sql
@@ -1,6 +1,6 @@
begin;
-alter table pgq.subscription constraint subscription_ukey unique (sub_queue, sub_consumer);
+alter table pgq.subscription add constraint subscription_ukey unique (sub_queue, sub_consumer);
create index rq_retry_owner_idx on pgq.retry_queue (ev_owner, ev_id);
\i ../sql/pgq/functions/pgq.current_event_table.sql
diff --git a/upgrade/src/v2.1.6_londiste.sql b/upgrade/src/v2.1.6_londiste.sql
new file mode 100644
index 00000000..57cff968
--- /dev/null
+++ b/upgrade/src/v2.1.6_londiste.sql
@@ -0,0 +1,6 @@
+begin;
+
+\i ../sql/londiste/functions/londiste.version.sql
+
+end;
+
diff --git a/upgrade/src/v2.1.6_pgq_ext.sql b/upgrade/src/v2.1.6_pgq_ext.sql
new file mode 100644
index 00000000..3aa3e82a
--- /dev/null
+++ b/upgrade/src/v2.1.6_pgq_ext.sql
@@ -0,0 +1,6 @@
+begin;
+
+\i ../sql/pgq_ext/functions/version.sql
+
+end;
+