@@ -441,6 +441,7 @@ module.exports = Adapter => class PostgreSQLAdapter extends Adapter {
441441 const client = this . client
442442 const typeMap = this . options . typeMap
443443 const primaryKey = this . keys . primary
444+ const recordTypes = this . recordTypes
444445
445446 // This is a little bit wrong, it is only safe to update within a
446447 // transaction. It's not possible to put it all in one update statement,
@@ -451,6 +452,7 @@ module.exports = Adapter => class PostgreSQLAdapter extends Adapter {
451452 let set = [ ]
452453
453454 for ( const field in update . replace ) {
455+ if ( ! ( field in recordTypes [ type ] ) ) continue
454456 const value = update . replace [ field ]
455457 index ++
456458 if ( Array . isArray ( value ) ) parameters . push ( value . map ( inputValue ) )
@@ -459,6 +461,7 @@ module.exports = Adapter => class PostgreSQLAdapter extends Adapter {
459461 }
460462
461463 for ( const field in update . push ) {
464+ if ( ! ( field in recordTypes [ type ] ) ) continue
462465 const value = update . push [ field ]
463466 index ++
464467
@@ -473,6 +476,7 @@ module.exports = Adapter => class PostgreSQLAdapter extends Adapter {
473476 }
474477
475478 for ( const field in update . pull ) {
479+ if ( ! ( field in recordTypes [ type ] ) ) continue
476480 const value = update . pull [ field ]
477481
478482 if ( Array . isArray ( value ) ) {
@@ -489,6 +493,8 @@ module.exports = Adapter => class PostgreSQLAdapter extends Adapter {
489493 set . push ( `"${ field } " = array_remove("${ field } ", $${ index } )` )
490494 }
491495
496+ // When no fields are to be updated, it's a no-op.
497+ if ( ! set . length ) return resolve ( 0 )
492498
493499 set = `set ${ set . join ( ', ' ) } `
494500
0 commit comments