Re: [GENERAL] Why LIMIT and OFFSET are commutative

2007-12-03 Thread Marco Colombo
Andrus wrote: >> Under what interpretation would the results differ? > > Results must differ for easy creation of LinQ-PostgreSQL driver. > If results are always the same , PostgreSQL should not allow to use both > order of clauses. > > Nicholas explains: > >Assuming the ordering is the same

Re: [GENERAL] Why LIMIT and OFFSET are commutative

2007-11-27 Thread Erik Jones
On Nov 26, 2007, at 5:29 AM, Andrus wrote: Under what interpretation would the results differ? Results must differ for easy creation of LinQ-PostgreSQL driver. If results are always the same , PostgreSQL should not allow to use both order of clauses. Nicholas explains: Assuming the ord

Re: [GENERAL] Why LIMIT and OFFSET are commutative

2007-11-27 Thread Gregory Stark
"Andrus" <[EMAIL PROTECTED]> writes: >> Under what interpretation would the results differ? > > Results must differ for easy creation of LinQ-PostgreSQL driver. > If results are always the same , PostgreSQL should not allow to use both > order of clauses. > > Nicholas explains: > >Assuming the

Re: [GENERAL] Why LIMIT and OFFSET are commutative

2007-11-27 Thread Andrus
> Under what interpretation would the results differ? Results must differ for easy creation of LinQ-PostgreSQL driver. If results are always the same , PostgreSQL should not allow to use both order of clauses. Nicholas explains: Assuming the ordering is the same on each of them (because Skip

Re: [GENERAL] Why LIMIT and OFFSET are commutative

2007-11-27 Thread Andrus
> That's SQL, my friend. OFFSET first, then LIMIT. Irrespective of the > order > in the query statement. It is what it is. SQL doesn't depend on LINQ for > its semantics. SQL requires strong order of all cases. Postgres syntax help about OFFSET / LIMIT also describes only single order. A

[GENERAL] Why LIMIT and OFFSET are commutative

2007-11-27 Thread Andrus
I found that SELECT * FROM foo ORDER BY bar OFFSET n LIMIT m and SELECT * FROM foo ORDER BY bar LIMIT m OFFSET n produce always same results. Why ? OFFSET and LIMIT operations are NOT commutative in general. Andrus. ---(end of broadcast)---

Re: [GENERAL] Why LIMIT and OFFSET are commutative

2007-11-27 Thread Lew
Andrus wrote: I found that SELECT * FROM foo ORDER BY bar OFFSET n LIMIT m and SELECT * FROM foo ORDER BY bar LIMIT m OFFSET n produce always same results. Why ? OFFSET and LIMIT operations are NOT commutative in general. Under what interpretation would the results differ?

Re: [GENERAL] Why LIMIT and OFFSET are commutative

2007-11-27 Thread Lew
Andrus wrote: Under what interpretation would the results differ? Results must differ for easy creation of LinQ-PostgreSQL driver. If results are always the same , PostgreSQL should not allow to use both order of clauses. Um, no, and your original post had nothing to do with LINQ. My answer

Re: [GENERAL] Why LIMIT and OFFSET are commutative

2007-11-27 Thread Lew
Andrus wrote: Why Postgres does not throw error when SELECT ... LIMIT ... OFFSET is used ? That's not sql and should cause error. Good point, it is not standard SQL. Postgres varies from the standard in several ways, some of them useful. (INSERT ... RETURNING is a useful one.) No SQL RDBMS