In this section, you will learn about the basic PostgreSQL security model. In general, we can see the PostgreSQL security models as seven basic layers:
Level 1: Turning the TCP on or off (
listen_addresses
inpostgresql.conf
, and so on)Level 2: Network authentication (
pg_hba.conf
)Level 3: Instance-level permissions
Level 4: Database-level permissions
Level 5: Schema-level permissions
Level 6: Table-level permissions
Level 7: Column permissions
Of course, there is more than just permissions on these seven levels; however, most administrators will face exactly those seven stages when securing their systems. So, let us go through these steps in detail and discuss each of them separately.