Check the current owner of the tables using the below query where schema_name is the name of the schema in lower case.
Continue readingCategory: Postgresql
PostgreSQL – Move table from one schema to another
Below command can be used to move table from one schema to another in Postgres database. ALTER TABLE table_name SET
Continue readingPostgreSQL – Change user password
Below is the syntax to change a user’s password in postgres database. ALTER USER username PASSWORD ‘newpassword’; You can also
Continue readingPostgreSQL – Concatenate values
Concatenation of values can be done either by using the concatenation operator || or the CONCAT function. Below is the
Continue readingPostgreSQL – COALESCE function
In Postgres database, COALESCE returns the first non-null value in the list of expressions passed to the function. It returns
Continue readingPostgreSQL – Add columns to an existing table
Below is the syntax to add a new column to an existing table in Postgres database. ALTER TABLE table_name ADD
Continue readingPostgreSQL – Drop not-null Constraint
Below is the syntax to remove the not null constraint from a table in postgres database ALTER TABLE table_name ALTER
Continue readingPostgreSQL – Create Table AS using a query
CREATE TABLE AS can be used to create a new table from the results of a query. Syntax: CREATE TABLE
Continue readingPostgreSQL – Dropping a Schema
Below is the syntax to drop a schema in postgres database. DROP SCHEMA schemaname; Above statement will fail if the
Continue readingPostgreSQL – Create Schema
A schema is a namespace for a collection of database objects. Below is the syntax to create a schema in
Continue reading