Skip to content

Instantly share code, notes, and snippets.

@marcocitus
Created May 4, 2015 13:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcocitus/752b4f05fb267714836b to your computer and use it in GitHub Desktop.
Save marcocitus/752b4f05fb267714836b to your computer and use it in GitHub Desktop.
Create different types of customer_reviews tables
CREATE TABLE customer_reviews_regular
(
customer_id TEXT not null,
review_date DATE not null,
review_rating INTEGER not null,
review_votes INTEGER,
review_helpful_votes INTEGER,
product_id CHAR(10) not null,
product_title TEXT not null,
product_sales_rank BIGINT,
product_group TEXT,
product_category TEXT,
product_subcategory TEXT,
similar_product_ids CHAR(10)[]
);
CREATE FOREIGN TABLE customer_reviews_cstore (
customer_id TEXT not null,
review_date DATE not null,
review_rating INTEGER not null,
review_votes INTEGER,
review_helpful_votes INTEGER,
product_id CHAR(10) not null,
product_title TEXT not null,
product_sales_rank BIGINT,
product_group TEXT,
product_category TEXT,
product_subcategory TEXT,
similar_product_ids CHAR(10)[]
)
SERVER cstore_server
OPTIONS(compression 'pglz');
CREATE TABLE customer_reviews_jsonb
(
data jsonb
);
CREATE FOREIGN TABLE customer_reviews_jcomp
(
data jsonb
)
SERVER cstore_server
OPTIONS(compression 'pglz');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment