Error: pq: 1 columns must reference exactly 1 columns in referenced table (found 2) I have a few tables and I am facing this issue most likely with the table "item". 
When I remove restaurant_id and category_id, it works fine. 

CREATE TABLE IF NOT EXISTS restaurant
(
    id              UUID NOT NULL PRIMARY KEY DEFAULT gen_random_uuid(),
    title           VARCHAR(50) NOT NULL UNIQUE
);

CREATE TABLE IF NOT EXISTS restaurant_gallery
(
    id              SERIAL,
    restaurant_id   UUID NOT NULL REFERENCES restaurant,
    image           VARCHAR NOT NULL,
    PRIMARY KEY (id, restaurant_id)
);

CREATE TABLE IF NOT EXISTS category
(
    id              SERIAL NOT NULL PRIMARY KEY,
    restaurant      UUID NOT NULL,
    label           VARCHAR(25) NOT NULL,

    UNIQUE (restaurant, label)
);

CREATE TABLE IF NOT EXISTS item
(
    id              SERIAL NOT NULL PRIMARY KEY,
    restaurant_id   UUID NOT NULL REFERENCES restaurant (id),
    category_id     SERIAL NOT NULL REFERENCES category (id),
    name            VARCHAR(25) NOT NULL,
    UNIQUE (id, restaurant_id)
);

CREATE TABLE IF NOT EXISTS item_gallery
(
    id              SERIAL,
    item_id         INT NOT NULL REFERENCES item,
    image           VARCHAR NOT NULL,
    PRIMARY KEY (id, item_id)
);



  Error:


pq: 1 columns must reference exactly 1 columns in referenced table (found 2)
Error: pq: 1 columns must reference exactly 1 columns in referenced table (found 2)
Failed running "sql"


Any help is highly appreciated!
For a foreign key, you need to tell Postgres which table you want to refer to and the name(s) of the field(s) within that table that you want to use as the foreign key(s): 

CREATE TABLE IF NOT EXISTS item
(
    id              SERIAL,
    restaurant_id   UUID         NOT NULL  REFERENCES restaurant ( id ) 
    category_id     INT          NOT NULL  REFERENCES category ( id ) 
    name            VARCHAR(25)  NOT NULL,
    PRIMARY KEY (id, restaurant_id)
);