SERIAL for id in cstore

31 views
Skip to first unread message

Morten Grøftehauge

unread,
Mar 2, 2020, 7:14:54 AM3/2/20
to cstore users
Hi Citus and cstore crew,

I was wondering if SERIAL works for the id column of a cstore table. As far as I can see in the Postgresql documentation functions like setval and nextval require UPDATE privileges - so not available for cstore? 

If it works fine do you then have an example of setting it up? 

 Cheers,
Morten Grøftehauge

Morten Grøftehauge

unread,
Mar 2, 2020, 7:32:29 AM3/2/20
to cstore users
Wait sorry, I think I get it. 

if the table is instantiated as 

-- create foreign table
CREATE FOREIGN TABLE customer_reviews
(
    review_id SERIAL,
    review_date DATE,
    review_rating INTEGER
)
SERVER cstore_server
OPTIONS(compression 'pglz');

and then to insert do 

\COPY customer_reviews(review_date, review_rating) FROM 'customer_reviews_1998.csv' WITH CSV;

right? Is there a sneaky way to insert using sql-alchemy?

Thanks,
Morten 
Reply all
Reply to author
Forward
0 new messages