# How to create roles, databases and tables in PostgreSQL (getting started with PostgreSQL, part two)

DevFeed: [How to create roles, databases and tables in PostgreSQL (getting started with PostgreSQL, part two)](<https://devfeed.tech/articles/how-to-create-roles-databases-and-tables-in-postgresql-getting-started-with-postgresql-part-two-86714.md>)

Original publisher: [Read original article](<https://www.red-gate.com/simple-talk/databases/postgresql/how-to-create-roles-databases-and-tables-in-postgresql-getting-started-with-postgresql-part-two/>)

Author: Grant Fritchey

Published: 2026-10-14T12:00:00Z

Content type: tutorial

Language: en

Sources: [Simple Talk](<https://devfeed.tech/sources/simple-talk.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [self-hosted databases vs managed services](<https://devfeed.tech/topics/self-hosted-databases-vs-managed-services.md>)

Tags: [best-practices](<https://devfeed.tech/tags/best-practices.md>), [command-line](<https://devfeed.tech/tags/command-line.md>), [database](<https://devfeed.tech/tags/database.md>), [database-administration](<https://devfeed.tech/tags/database-administration.md>), [databases](<https://devfeed.tech/tags/databases.md>), [featured](<https://devfeed.tech/tags/featured.md>), [gettingstartedpostgresgrant](<https://devfeed.tech/tags/gettingstartedpostgresgrant.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [psql](<https://devfeed.tech/tags/psql.md>), [roles](<https://devfeed.tech/tags/roles.md>), [schemas](<https://devfeed.tech/tags/schemas.md>), [tables](<https://devfeed.tech/tags/tables.md>)

## AI overview

A step-by-step PostgreSQL tutorial shows how to create a dedicated role and database, organize schemas, and create or alter tables with constraints using psql. It explains least-privilege ownership, search_path behavior, and how dependencies affect dropping tables.

## Source excerpt

Learn how to create roles, databases, schemas, and tables in PostgreSQL using psql. Step-by-step commands, real output examples, and best practices included.... The post How to create roles, databases and tables in PostgreSQL (getting started with PostgreSQL, part two) appeared first on Simple Talk.