diff --git a/server/config/database.js b/server/config/database.js index 47b4e1a..8e87430 100644 --- a/server/config/database.js +++ b/server/config/database.js @@ -83,7 +83,9 @@ class PostgresAdapter { let pgSql = convertPlaceholders(sql); const isInsert = /^\s*INSERT/i.test(pgSql); if (isInsert && !/RETURNING/i.test(pgSql)) { - pgSql += ' RETURNING id'; + // Some tables (e.g. settings, oauth_states) have no "id" column. + // Return the inserted row generically and read id only when present. + pgSql += ' RETURNING *'; } const result = await this.pool.query(pgSql, params); return {