Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How many schemas can be created in postgres

Tags:

postgresql

While implementing solution to a multi tenant using postgres I needed an answer on how much the maximum schemas can reside in one postgres database.

like image 229
Arsalan T Avatar asked Feb 15 '13 11:02

Arsalan T


People also ask

Does Postgres support multiple schemas?

PostgreSQL supports having multiple schemas in a single database there by letting you namespace different features into different schemas. For example, you can have a database named postgres and have multiple schemas based on your application like ecommerce , auth etc.

How many schemas can we have in a database?

So, the maximum numbers of schemas in a database is limited to the maximum number of integer data type (2^31-1 is the max of int).

Can you have multiple schemas?

In the Oracle database system, the term database schema, which is also known as "SQL schema," has a different meaning. Here, a database can have multiple schemas (or “schemata,” if you're feeling fancy). Each one contains all the objects created by a specific database user.

Can we create schema in PostgreSQL?

PostgreSQL has a CREATE SCHEMA statement that is used to create a new schema in a database. Syntax: CREATE SCHEMA [IF NOT EXISTS] schema_name; Let's analyze the above syntax: First, specify the name of the schema after the CREATE SCHEMA keywords.


1 Answers

We tested thousands schemas - with thousands tables without problem. There are a few known issues

  • problems with GUI administration - slow start due read a complete object tree on start,
  • problems with pg_dump - slow start of backup - needs lot of time for locking objects.
like image 115
Pavel Stehule Avatar answered Oct 20 '22 08:10

Pavel Stehule