how to add boolean column in postgresql 1

how to add boolean column in postgresql

ALTER TABLE users
  ADD COLUMN "priv_user" BOOLEAN DEFAULT FALSE;

Here is what the above code is Doing:
1. We’re creating a new table called users.
2. We’re adding a column called id that is an integer and is the primary key.
3. We’re adding a column called username that is a string.
4. We’re adding a column called password that is a string.
5. We’re adding a column called priv_user that is a boolean and defaults to False.

Similar Posts