-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[YSQL] Please support insert multiple values #2489
Comments
@teochenglim This is already supported, for example:
Can you add more details on the query that you tried and the error that you got? |
Sure. But my case is slightly complex than yours. drop table a;
drop table b;
drop table c;
CREATE TABLE B (
id SERIAL PRIMARY KEY,
name VARCHAR(3) UNIQUE
);
CREATE TABLE C (
id SERIAL PRIMARY KEY,
num INT UNIQUE
);
INSERT INTO B (name) VALUES ('1'), ('2'), ('3'), ('4');
INSERT INTO C (num) VALUES (1), (2), (3), (4);
CREATE TABLE A (
id SERIAL PRIMARY KEY,
AA VARCHAR(3) NOT NULL REFERENCES B ( name ),
AB INTEGER NOT NULL REFERENCES C ( num ),
AC TIMESTAMP WITHOUT TIME ZONE DEFAULT now()
);
INSERT INTO A (AB, AA) VALUES
(4, 'AAA'),
(4, 'AAB'),
(4, 'AAC'),
(4, 'AAD'),
(4, 'AAE'),
(4, 'AAF'),
(4, 'AAG'),
(4, 'AAH'),
(4, 'AAI'),
(4, 'AAJ'),
(4, 'AAK');
ERROR: Operation only supported in SERIALIZABLE isolation level
HINT: See https://github.com/YugaByte/yugabyte-db/issues/1199. Click '+' on the description to raise its priority
|
That error is related to foreign keys and not to multiple insert values. To make this work, you can do
|
Good to know. thanks. |
The foreign keys issue with default isolation level is being tracked by #1199. Closing this particular issue since INSERT with multiple value lists is already supported. |
Please support this popular feature.
The text was updated successfully, but these errors were encountered: