Paste this into a new question or an answer at dba.stackexchange.com:
<!-- --> > select version(); > > <pre> > | version | > | :----------------------------------------------------------------------------------------------------- | > | PostgreSQL 12.6 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.3.1 20191121 (Red Hat 8.3.1-5), 64-bit | > </pre> <!-- --> > CREATE TABLE xyz (a INT PRIMARY KEY, b TEXT); > > <pre> > ✓ > </pre> <!-- --> > INSERT INTO xyz VALUES (1, 'sfasf'), (2, 'afdsa'); > > <pre> 2 rows affected > </pre> <!-- --> > ALTER TABLE xyz DROP COLUMN a; > > <pre> > ✓ > </pre> <!-- --> > SELECT * FROM xyz; > > <pre> > | b | > | :---- | > | sfasf | > | afdsa | > </pre> *db<>fiddle [here](https://dbfiddle.uk/?rdbms=postgres_12&fiddle=3865bd3ed5a4ca4e550c5539a3235ca5)*
back to fiddle