Is there a security problem using the public schema in Postgresql?

Asked

Viewed 414 times

1

First time I’m working with postgresql and I’m wondering if you have a security problem using the public Schema it creates ? Or if it’s just a matter of organization

2 answers

1

Hello!

The recommendation is to create a single database with several schematics appointed. This is different from a common (and older) practice of create multiple databases and store the objects within the schema "public". In addition, it is recommended to remove the public scheme.

These are some of the advantages of following this recommendation:

  • Access to the cross-schema object is possible from a single database connection.

  • Granting access to a schema is performed by means of a GRANT instruction versus a reconfiguration of the pg_hba.conf file.

  • Schematics are the ANSI standard for object separation and name spacing.

  • Managing only one database within a single server (Postgresql cluster).

More details here

1

No need to remove the public, only modify the access of users if you have more than one administrator or users with access to db.

If you need to restrict organized users you can create other schemas and put the access by schema (the tables need to be relocated to the other schemas if db already exists), ie grupo A can only access the schema A.

inserir a descrição da imagem aqui

Documentación Oficial: Postgresql

Browser other questions tagged

You are not signed in. Login or sign up in order to post.