---
title: PostgreSQL Configuration
slug: kron-dam-supported-databases-and-databases-clients/postgresql-configuration
docTags: 
createdAt: 2025-01-14T09:18:33.689Z
---

### Purpose&#x20;

In PostgreSQL, the goal is to allow the user \[username] to read data from specific schemas (e.g., public, information\_schema, etc.) and from catalog tables if necessary.&#x20;

### Grant Permission

:::CodeblockTabs
PostgreSQL

```pgsql
-- Grant SELECT on all tables under " public "
GRANT SELECT ON ALL TABLES IN SCHEMA public TO [ username ];

-- Grant SELECT on all tables under " information_schema "
GRANT SELECT ON ALL TABLES IN SCHEMA information_schema TO [
username ];

 -- Allow SELECT on pg_catalog tables
GRANT SELECT ON pg_catalog . pg_class TO [ username ];
GRANT SELECT ON pg_catalog . pg_attribute TO [ username ];
GRANT SELECT ON pg_catalog . pg_database TO [ username ];
GRANT SELECT ON pg_catalog . pg_collation TO [ username ];
GRANT SELECT ON pg_catalog . pg_tables TO [ username ];
GRANT SELECT ON pg_catalog . pg_views TO [ username ];

-- Allow SELECT on information_schema tables
GRANT SELECT ON information_schema . columns TO [ username ];
GRANT SELECT ON information_schema . views TO [ username ];
GRANT SELECT ON ALL TABLES IN SCHEMA < schema_name > TO [ username ];
```
:::

### Testing Permissions&#x20;

To verify that \[username] can read from the PostgreSQL catalogs or schema tables, execute:&#x20;

:::CodeblockTabs
PostgreSQL

```pgsql
-- Example test for pg_catalog
SELECT * FROM pg_catalog . pg_tables ;
```
:::

If the user can run this query without an error, the privileges have been successfully applied.&#x20;
