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: content/docs/change-database/troubleshoot.md
+7-20Lines changed: 7 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,24 +17,18 @@ _Also applicable to Redshift and RisingWave_
17
17
18
18
Following permission errors are likely to happen if either conditions meet:
19
19
20
-
1. Your PostgreSQL instance in hosted in the cloud, which means the configured Bytebase database instance
20
+
1. Your PostgreSQL instance is hosted in the cloud, which means the configured Bytebase database instance
21
21
user does not have `superuser` role.
22
-
1. Your database/table has different owners.
22
+
1. The instance user you configure in Bytebase is different from the database OWNER.
23
+
1. Your database/table has different OWNERs.
23
24
24
25
</HintBlock>
25
26
26
27
### ERROR: permission denied to set role xxx (SQLSTATE 42501)
27
28
28
-
You may encounter this error when executing the schema migration on PostgreSQL databases.
29
-
30
-
When Bytebase executes schema migration on PostgreSQL databases, it will not use the configured user
31
-
in the instance to execute. Instead, it uses [`SET LOCAL ROLE`](https://github.com/bytebase/bytebase/blob/b79d79d81279a29ab6e9f147632f5a2631755299/backend/plugin/db/pg/pg.go#L340-L341) to switch to the
32
-
targeting PostgreSQL database owner.
33
-
34
-
Bytebase does this because if you are creating a table, it's likely you want the created table
35
-
owner to be the database owner specific to the database instead of that shared Bytebase user.
29
+
This could happen if you turn on [Postgres database tenant mode](/docs/change-database/issue/#postgres-database-tenant-mode).
36
30
37
-
You need to grant the database owner permission to the Bytebase user configured in the PostgreSQL instance.
31
+
You need to grant the database owner permission to the Bytebase user configured in your PostgreSQL instance.
38
32
39
33
```sql
40
34
-- Suppose the Bytebase user is `bytebase`
@@ -50,16 +44,9 @@ If you use AlloyDB, the database owner must NOT be created via [Cloud IAM](https
50
44
51
45
### ERROR: must be owner of table xxx (SQLSTATE 42501)
52
46
53
-
You may encounter this error when executing the schema migration on PostgreSQL databases.
54
-
55
-
When Bytebase executes schema migration on PostgreSQL databases, it will not use the configured user
56
-
in the instance to execute. Instead, it uses [`SET LOCAL ROLE`](https://github.com/bytebase/bytebase/blob/b79d79d81279a29ab6e9f147632f5a2631755299/backend/plugin/db/pg/pg.go#L340-L341) to switch to the
57
-
targeting PostgreSQL database owner.
58
-
59
-
Bytebase does this because if you are creating a table, it's likely you want the created table
60
-
owner to be the database owner specific to the database instead of that shared Bytebase user.
47
+
This could happen if you turn on [Postgres database tenant mode](/docs/change-database/issue/#postgres-database-tenant-mode).
61
48
62
-
However, for some sophisticated setup where database owner and table owner are different, this causes problem.
49
+
For some sophisticated setup where database owner and table owner are different, this causes problem.
63
50
Because only table owner can alter that table schema, and if the database owner is not a member of
64
51
the table owner, then the execution will throw the `ERROR: must be owner of table xxx` error.
0 commit comments