Diagnostic Queries
Symptoms
A WHERE CURRENT OF cursor clause was used against a table type that doesn’t support it (e.g. a view or foreign table). PostgreSQL raises SQLSTATE 0A000 (feature_not_supported).
- WHERE CURRENT OF used on an unsupported table type.
- Cursor-positioned updates require a simple updatable scan.
- Common with views, foreign tables, or join cursors.
What the server log shows
ERROR: WHERE CURRENT OF is not supported for this table type
Why PostgreSQL raises this — what the manual says
As the UPDATE reference (Parameters) explains:
WHERE CURRENT OF updates the row at a cursor’s current position, but it is only supported for cursors over ordinary tables — not for views, foreign tables, or similar relation types; rewrite the statement with an explicit WHERE condition on a key column.
WHERE CURRENT OF updates the row the cursor currently points at, which requires the cursor to scan the physical target table directly. View/foreign/join cursors don’t expose a single positionable physical row, so PostgreSQL reports 0A000.
Common causes
- The cursor is over a view, foreign table, or a join.
- The cursor query isn’t a simple scan of the update target.
- The table type doesn’t support cursor positioning.
How to fix it
- Open the cursor as a simple
SELECTdirectly on the target table. - Use a primary-key predicate instead of
WHERE CURRENT OF. - For foreign tables/views, update by key rather than by cursor position.
Related & next steps
Reference: PostgreSQL 18 — UPDATE.
Thanks — noted. This helps keep the database accurate.