Search code examples
databasepostgresqlcitus

citusdb: psql commands not working


I am trying for the first time citusdb, and in the download page, they put a getting started guide, so I am following it.

First, I am trying this on my local computer, and with the sample data on the third point of the getting started guide here.

There, they offer a modified psql so you can use it with citusdb. First I connect with this:

/opt/citusdb/2.0/bin/psql -U postgres -h localhost -d postgres

Then, when I try to create a database, the guide says that you can use the reserved word DISTRIBUTE, but when I try the command on the guide:

CREATE TABLE customer_reviews
(
    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)[]
)
DISTRIBUTE BY APPEND (review_date);

It seems that the psql is not accepting the DISTRIBUTE word, because it shows an syntax error at or near DISTRIBUTE

Please help if someone has used this, and knows what the problem is, maybe it is too obvious, but it is my first time with citusdb.

Thank you.


Solution

  • I'd say you're connecting to a normal PostgreSQL instance, not their hacked-up PostgreSQL. Try select version() to confirm that.

    Perhaps you're running CitusDB on a different port, like 5433?