I'm fairly new to SQL and I don't really understand what constitues a valid query:
CREATE TABLE table_name (
user_id UUID PRIMARY KEY NOT NULL,
additional_info JSONB,
);
Why is the above invalid?
CodePudding user response:
Can't add a comment as I don't have enough points
CREATE TABLE table_name (
user_id UUID PRIMARY KEY NOT NULL,
additional_info JSONB
);
Should work as tested on db-fiddle.com for postgresql. As WoundedStevenJones pointed out there's a trailing comma
CodePudding user response:
CREATE TABLE table_name (
user_id UUID PRIMARY KEY NOT NULL,
additional_info JSONB
);
It's probably due to the trailing comma ,
after JSONB.