Using Information Schema
SELECT
table_schema,
table_name
FROM
information_schema.tables;
Taking the look at the columns of a certain table using the Information Schema
SELECT
table_name,
column_name,
data_type
FROM
information_schema.tables
WHERE
table_name = 'pg_config';
Creating new tables with CREATE TABLE
CREATE TABLE table_name (
column_a data_type,
column_b data_type,
column_c data_type
);
Example:
CREATE TABLE weather (
clouds text,
temperature numeric,
weather_station char(5)
)
INSERT INTO statement
INSERT INTO table_name (column_a, column_b)
VALUES ("value_a", "value_b");
RENAME a column
ALTER TABLE table_name
RENAME COLUMN old_name TO new_name;
DROP a column
ALTER TABLE table_name
DROP COLUMN column_name;