Skip to content

Commit 90969da

Browse files
committed
Add a new error code.
1 parent a8b2a12 commit 90969da

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

modules/module-postgres/src/replication/replication-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ WHERE c.oid = $1::oid;
184184
// Don't skip, since we _may_ still be able to get results.
185185
return {
186186
canRead: false,
187-
message: `Row Level Security is enabled on table ${row.tablename}. To make sure that ${row.username} can read the table, run: 'ALTER ROLE ${row.username} BYPASSRLS'.`
187+
message: `[${ErrorCode.PSYNC_S1145}] Row Level Security is enabled on table "${row.tablename}". To make sure that ${row.username} can read the table, run: 'ALTER ROLE ${row.username} BYPASSRLS'.`
188188
};
189189
}
190190

packages/service-errors/src/codes.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,18 @@ export enum ErrorCode {
168168
*/
169169
PSYNC_S1144 = 'PSYNC_S1144',
170170

171+
/**
172+
* Table has RLS enabled, but the replication role does not have the BYPASSRLS attribute.
173+
*
174+
* We recommend using a dedicated replication role with the BYPASSRLS attribute for replication:
175+
*
176+
* ALTER ROLE powersync_role BYPASSRLS
177+
*
178+
* An alternative is to create explicit policies for the replication role. If you have done that,
179+
* you may ignore this warning.
180+
*/
181+
PSYNC_S1145 = 'PSYNC_S1145',
182+
171183
// ## PSYNC_S12xx: MySQL replication issues
172184

173185
// ## PSYNC_S13xx: MongoDB replication issues

0 commit comments

Comments
 (0)