citusdata / pg_shard

ATTENTION: pg_shard is superseded by Citus, its more powerful replacement
https://github.com/citusdata/citus
GNU Lesser General Public License v3.0
1.06k stars 63 forks source link

Bump default version; add upgrade script #72

Closed jasonmp85 closed 9 years ago

jasonmp85 commented 9 years ago

Adding a new UDF means adding an upgrade script to augment existing installations of pg_shard.

fixes #69

coveralls commented 9 years ago

Coverage Status

Coverage remained the same at 93.2% when pulling 78ffe34495a5a989e9f5c676f1f1b9eeb959dc7f on feature-upgrade_script-#69 into 9838e1f183223af41260d9ac02e6081dfaaa0c94 on develop.

jasonmp85 commented 9 years ago

As a sanity check, I looked over at cstore, which looks exactly like pg_shard will after this Pull Request.

jasonmp85 commented 9 years ago

Testing (not currently automated in any fashion):

Here is the SQL for the upgrade:

CREATE EXTENSION pg_shard VERSION '1.0';
ALTER EXTENSION pg_shard UPDATE;
# \dx
#                                List of installed extensions
#    Name   | Version |   Schema   |                       Description                       
# ----------+---------+------------+---------------------------------------------------------
#  pg_shard | 1.1     | public     | extension for sharding across remote PostgreSQL servers
#  plpgsql  | 1.0     | pg_catalog | PL/pgSQL procedural language
# (2 rows)
jasonmp85 commented 9 years ago

So yeah, the two caveats are:

But this patch works, works with an upgrade from 1.0, and matches what we're doing in cstore.