You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/integrations/sources/postgres.md
+18-5Lines changed: 18 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -37,18 +37,18 @@ This is dependent on your networking setup. The easiest way to verify if Airbyte
37
37
38
38
#### 2. Create a dedicated read-only user with access to the relevant tables \(Recommended but optional\)
39
39
40
-
This step is optional but highly recommended to allow for better permission control and auditing. Alternatively, you can use Airbyte with an existing user in your database.
40
+
This step is optional but highly recommended for better permission control and auditing. Alternatively, you can use Airbyte with an existing user in your database.
41
41
42
42
To create a dedicated database user, run the following commands against your database:
43
43
44
44
```sql
45
-
CREATEUSERairbyte PASSWORD 'your_password_here';
45
+
CREATE USER <username> PASSWORD 'your_password_here';
46
46
```
47
47
48
48
Then give it access to the relevant schema:
49
49
50
50
```sql
51
-
GRANT USAGE ON SCHEMA <schema_name> TO airbyte
51
+
GRANT USAGE ON SCHEMA <schema_name> TO <username>
52
52
```
53
53
54
54
Note that to replicate data from multiple Postgres schemas, you can re-run the command above to grant access to all the relevant schemas, but you'll need to set up multiple sources connecting to the same db on multiple schemas.
@@ -58,10 +58,23 @@ Next, grant the user read-only access to the relevant tables. The simplest way i
58
58
```sql
59
59
GRANTSELECTON ALL TABLES IN SCHEMA <schema_name> TO airbyte;
60
60
61
-
# Allow airbyte user to see tables created in the future
62
-
ALTER DEFAULT PRIVILEGES IN SCHEMA <schema_name>GRANTSELECTON TABLES TO airbyte;
61
+
-- Allow user to see tables created in the future
62
+
ALTER DEFAULT PRIVILEGES IN SCHEMA <schema_name>GRANTSELECTON TABLES TO <username>;
63
63
```
64
64
65
+
Currently, there is no way to sync a subset of columns using the Postgres source connector.
66
+
- When setting up a connection, you can only choose which tables to sync, but not columns (issue [#2227](https://github.com/airbytehq/airbyte/issues/2227)).
67
+
- If the user account can only access a subset of columns (i.e. has no `SELECT` permission for the full table), the connection check will pass. However, the data sync will fail with permission denied exception (issue [#9771](https://github.com/airbytehq/airbyte/issues/9771)).
68
+
69
+
The short-term workaround for both issues is to create a view on the specific columns, and grant the user read permission of that view:
0 commit comments