Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #121 from citusdata/develop
cstore v1.5
  • Loading branch information
mtuncer committed Sep 5, 2016
2 parents 49ad76e + 932b8cf commit 0e8d1d2
Show file tree
Hide file tree
Showing 16 changed files with 311 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -11,7 +11,7 @@ env:
before_install:
- sudo apt-get update -qq
- sudo update-alternatives --remove-all postmaster.1.gz
- git clone --depth 1 https://github.com/citusdata/tools.git
- git clone -b v0.3.3 --depth 1 https://github.com/citusdata/tools.git
- tools/travis/nuke_pg.sh
install:
- sudo apt-get install protobuf-c-compiler
Expand Down
6 changes: 3 additions & 3 deletions META.json
Expand Up @@ -2,15 +2,15 @@
"name": "cstore_fdw",
"abstract": "Columnar Store for PostgreSQL",
"description": "PostgreSQL extension which implements a Columnar Store.",
"version": "1.4.1",
"version": "1.5.0",
"maintainer": "Murat Tuncer <mtuncer@citusdata.com>",
"license": "apache_2_0",
"provides": {
"cstore_fdw": {
"abstract": "Foreign Data Wrapper for Columnar Store Tables",
"file": "cstore_fdw--1.4.sql",
"file": "cstore_fdw--1.5.sql",
"docfile": "README.md",
"version": "1.4.1"
"version": "1.5.0"
}
},
"prereqs": {
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Expand Up @@ -11,8 +11,8 @@ OBJS = cstore.pb-c.o cstore_fdw.o cstore_writer.o cstore_reader.o \
cstore_metadata_serialization.o cstore_compression.o

EXTENSION = cstore_fdw
DATA = cstore_fdw--1.4.sql cstore_fdw--1.3--1.4.sql cstore_fdw--1.2--1.3.sql \
cstore_fdw--1.1--1.2.sql cstore_fdw--1.0--1.1.sql
DATA = cstore_fdw--1.5.sql cstore_fdw--1.4--1.5.sql cstore_fdw--1.3--1.4.sql \
cstore_fdw--1.2--1.3.sql cstore_fdw--1.1--1.2.sql cstore_fdw--1.0--1.1.sql

REGRESS = create load query analyze data_types functions block_filtering drop \
insert copyto alter truncate
Expand Down Expand Up @@ -40,8 +40,8 @@ ifndef MAJORVERSION
MAJORVERSION := $(basename $(VERSION))
endif

ifeq (,$(findstring $(MAJORVERSION), 9.3 9.4 9.5))
$(error PostgreSQL 9.3 or 9.4 or 9.5 is required to compile this extension)
ifeq (,$(findstring $(MAJORVERSION), 9.3 9.4 9.5 9.6))
$(error PostgreSQL 9.3 or 9.4 or 9.5 or 9.6 is required to compile this extension)
endif

cstore.pb-c.c: cstore.proto
Expand Down
17 changes: 12 additions & 5 deletions README.md
Expand Up @@ -67,8 +67,8 @@ installation's bin/ directory path. For example:
PATH=/usr/local/pgsql/bin/:$PATH make
sudo PATH=/usr/local/pgsql/bin/:$PATH make install

**Note.** cstore_fdw requires PostgreSQL 9.3, 9.4 or 9.5. It doesn't support earlier
versions of PostgreSQL.
**Note.** cstore_fdw requires PostgreSQL 9.3, 9.4, 9.5 or 9.6. It doesn't
support earlier versions of PostgreSQL.


Usage
Expand Down Expand Up @@ -115,13 +115,13 @@ most efficient execution plan for each query.
commands. We also don't support single row inserts.


Updating from earlier versions to 1.4.1
Updating from earlier versions to 1.5
---------------------------------------

To update an existing cstore_fdw installation from versions earlier than 1.4.1
To update an existing cstore_fdw installation from versions earlier than 1.5
you can take the following steps:

* Download and install cstore_fdw version 1.4.1 using instructions from the "Building"
* Download and install cstore_fdw version 1.5 using instructions from the "Building"
section,
* Restart the PostgreSQL server,
* Run ```ALTER EXTENSION cstore_fdw UPDATE;```
Expand Down Expand Up @@ -284,6 +284,13 @@ the installation:

Changeset
---------
### Version 1.5
* (Feature) Added support for PostgresSQL 9.6.
* (Fix) Removed table data when cstore_fdw table is indirectly dropped.
* (Fix) Removed unused code fragments.
* (Fix) Fixed column selection logic to return columns used in expressions.
* (Fix) Prevented alter table command from changinf column type to incompatible types.

### Version 1.4.1

* (Fix) Compatibility fix for Citus [copy command][copy-command].
Expand Down
28 changes: 28 additions & 0 deletions cstore_fdw--1.4--1.5.sql
@@ -0,0 +1,28 @@
/* cstore_fdw/cstore_fdw--1.4--1.5.sql */

CREATE FUNCTION cstore_clean_table_resources(oid)
RETURNS void
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT;

CREATE OR REPLACE FUNCTION cstore_drop_trigger()
RETURNS event_trigger
LANGUAGE plpgsql
AS $csdt$
DECLARE v_obj record;
BEGIN
FOR v_obj IN SELECT * FROM pg_event_trigger_dropped_objects() LOOP

IF v_obj.object_type NOT IN ('table', 'foreign table') THEN
CONTINUE;
END IF;

PERFORM cstore_clean_table_resources(v_obj.objid);

END LOOP;
END;
$csdt$;

CREATE EVENT TRIGGER cstore_drop_event
ON SQL_DROP
EXECUTE PROCEDURE cstore_drop_trigger();
29 changes: 28 additions & 1 deletion cstore_fdw--1.4.sql → cstore_fdw--1.5.sql
@@ -1,4 +1,4 @@
/* cstore_fdw/cstore_fdw--1.4.sql */
/* cstore_fdw/cstore_fdw--1.5.sql */

-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION cstore_fdw" to load this file. \quit
Expand Down Expand Up @@ -30,3 +30,30 @@ CREATE FUNCTION cstore_table_size(relation regclass)
RETURNS bigint
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT;

CREATE OR REPLACE FUNCTION cstore_clean_table_resources(oid)
RETURNS void
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT;

CREATE OR REPLACE FUNCTION cstore_drop_trigger()
RETURNS event_trigger
LANGUAGE plpgsql
AS $csdt$
DECLARE v_obj record;
BEGIN
FOR v_obj IN SELECT * FROM pg_event_trigger_dropped_objects() LOOP

IF v_obj.object_type NOT IN ('table', 'foreign table') THEN
CONTINUE;
END IF;

PERFORM cstore_clean_table_resources(v_obj.objid);

END LOOP;
END;
$csdt$;

CREATE EVENT TRIGGER cstore_drop_event
ON SQL_DROP
EXECUTE PROCEDURE cstore_drop_trigger();

0 comments on commit 0e8d1d2

Please sign in to comment.