0
votes

I am trying to load the data into the tables but i get this error: "COPY INTO: insufficient privileges: COPY INTO from .. LOCKED requires tables without indices"

The code I use to create the table:

CREATE TABLE region (
r_regionkey INT NOT NULL,
r_name  CHAR(25)    NOT NULL,
r_comment   VARCHAR(152));

The code I use to load the table:

COPY 5 RECORDS INTO region FROM 'C:\Users\gewrg\Desktop\ADM 1\tpch_2_17_1\dbgen\SF-1\data\region.tbl' USING DELIMITERS '|', '|\n', '"' LOCKED;

Is there a problem with the absolute path I use?

2

2 Answers

1
votes

To use COPY INTO and COPY FROM, users need to be explicitly granted the permissions. Please see https://www.monetdb.org/Documentation/SQLReference/DataDefinition/Privileges/GrantAndRevoke.

If LOCKED is the cause of your trouble as mentioned above by Pedro, you can just remove it. LOCKED was introduced for higher data loading speed when there is no contention but in my experiences, there's barely any performance gain.

0
votes

Are you sure you didn't create any key (primary or foreign) before the COPY INTO statement? That's because MonetDB creates an index for every primary/foreign key created, then you get this error message on COPY INTO LOCKED.

(This looks more like a comment, because I don't have enough reputation to give comments yet)