Is there any security problem using public schema in PostgreSQL?

1

First time I'm working with postgreSQL and I'm having this doubt if it has any security issues using the public Schema that it creates? Or if it's just a matter of organization

    
asked by anonymous 12.10.2017 / 20:38

2 answers

1

Hello

  

The recommendation is to create a single database with multiple schemas   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 schema.

     

Here are some of the benefits of following this recommendation:

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

  •   
  • Granting access to a schema is performed through a GRANT statement versus a reconfiguration of the pg_hba.conf file.

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

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

  •   

More details here

    
09.10.2018 / 16:07
1

You do not need to remove public, only modify user access if you have more than one administrator or users with db access.

If you need to restrict the users in an organized way you can create other schemas and put the access by schema (the tables need to be reallocated to the other schemas in case the db already exists), that is grupo A can only access the schema A .

OfficialDocumentation: PostgreSQL

    
09.10.2018 / 16:51