How to add or delete a column in PostgreSQL table

In this article, we will sse how to add or delete a column in PostgreSQL table step by step.

In some cases it is required to add column to a table or delete a column from table once it is created.

Add a column to PostgreSQL table

Continue reading How to add or delete a column in PostgreSQL table

How to move tables from one schema to another in PostgreSQL

In this article, we will see how to move tables from one schema to another in PostgreSQL. We can move the tables from one schema to another by using alter table command. Schemas are database objects. Same schema can be exists in different. But, tables of schema are different.

Syntax:

ALTER TABLE table_name SET SCHEMA schema_name;

Examples to move tables from one schema to another in PostgreSQL:
Continue reading How to move tables from one schema to another in PostgreSQL

How to drop multiple columns in PostgreSQL

In this article, we will see how to drop multiple columns in PostgreSQL with examples. We can drop columns by using alter table command.

Syntax to drop multiple columns in PostgreSQL
Continue reading How to drop multiple columns in PostgreSQL

How to rename column in PostgreSQL

In this article, we will see how to rename a column in PostgreSQL with examples using ALTER TABLE command with RENAME parameter.

To rename a column of a table, you use the ALTER TABLE statement with RENAME COLUMN clause as follows:

Syntax to PostgreSQL Rename column:

ALTER TABLE table_name RENAME COLUMN column_name TO new_column_name;

Continue reading How to rename column in PostgreSQL

How to rename PostgreSQL Table

In this article, we will see how to rename PostgreSQL Table. ALTER TABLE is the command used to rename table in PostgreSQL Server. To execute ALTER TABLE, we must be owner of table or superuser or granted alter table permission on the table.

PostgreSQL Rename Table Syntax:

ALTER TABLE name RENAME TO new_name

Continue reading How to rename PostgreSQL Table