haskell-beam / haskell-beam/beam

beam-postgres: Not possible to UPDATE .. FROM .. RETURNING

Open
#280 1 comment 5 reactions 0 assignees View on GitHub
enhancement
Dominant language
Haskell
Stars
635
Forks
193
PR merge metrics
No merged PRs in 30d

Description

I need to run a query [like the following](https://stackoverflow.com/a/7927957):

```sql
UPDATE tbl x
SET tbl_id = 24
, name = 'New Gal'
FROM (SELECT tbl_id, name FROM tbl WHERE tbl_id = 4 FOR UPDATE) y
WHERE x.tbl_id = y.tbl_id
RETURNING y.tbl_id AS old_id, y.name AS old_name, x.tbl_id, x.name;
```

but afaik this isn't possible in `beam` at the moment.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.