0 votes
1 view
in SQL by (20.3k points)

How can I accomplish this using Postgres? I've tried the code below but it doesn't work:

ALTER TABLE mytable ALTER COLUMN mycolumn BIGINT NULL; 

1 Answer

0 votes
by (40.4k points)

Try this code:

ALTER TABLE mytable ALTER COLUMN mycolumn DROP NOT NULL;

Note: Don't specify the type when you're just changing the nullability.

For more information, you can refer to this link:

https://www.postgresql.org/docs/current/sql-altertable.html

Related questions

0 votes
1 answer
asked Jul 5, 2019 in SQL by Tech4ever (20.3k points)
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...