postgres alter table add primary key
-- To set a column as primary key:
ALTER TABLE distributors ADD PRIMARY KEY (tablename);
postgres alter table add primary key
-- To set a column as primary key:
ALTER TABLE distributors ADD PRIMARY KEY (tablename);
postgresql primary key
CREATE TABLE users (
id SERIAL PRIMARY KEY, # Primary key
username VARCHAR(50),
col_name3 data_type,
…
);
CREATE TABLE posts (
id SERIAL PRIMARY KEY, # Primary key
url VARCHAR(200),
user_id INTEGER REFERENCES users(id), # foreign key
col_name3 data_type,
col_name4 data_type key_type,
…
);
create table postgresql primary key
CREATE TABLE TABLE (
column_1 data_type PRIMARY KEY,
column_2 data_type,
…
);
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us