You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "iffyio (via GitHub)" <gi...@apache.org> on 2026/07/01 09:14:04 UTC
Re: [PR] Postgres: parse LIMIT after the row-locking clause [datafusion-sqlparser-rs]
iffyio commented on code in PR #2391:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2391#discussion_r3504654494
##########
src/parser/mod.rs:
##########
@@ -14479,6 +14479,13 @@ impl<'a> Parser<'a> {
locks.push(self.parse_lock()?);
}
}
+
+ // PostgreSQL accepts `LIMIT`/`OFFSET` after the row-locking clause
+ // (e.g. `... FOR UPDATE SKIP LOCKED LIMIT 5`) as well as before it.
+ if limit_clause.is_none() && self.dialect.supports_limit_after_locking_clause() {
Review Comment:
```suggestion
if limit_clause.is_none() {
```
I think we can skip the dialect flag entirely here, since the FOR UPDATE isn't dialect guarded either?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org