Re: COPY FROM WHEN condition
Surafel Temsgen <surafel3000@gmail.com>
From: Surafel Temesgen <surafel3000@gmail.com>
To: dean.a.rasheed@gmail.com
Cc: tomas.vondra@2ndquadrant.com, Adam Berlin <berlin.ab@gmail.com>, pgsql-hackers@lists.postgresql.org
Date: 2018-11-26T13:05:15Z
Lists: pgsql-hackers
On Sat, Nov 24, 2018 at 12:02 PM Dean Rasheed <dean.a.rasheed@gmail.com> wrote: > Right now we have 2 syntaxes for filtering rows in queries, both of > which use WHERE immediately before the condition: > > 1). SELECT ... FROM ... WHERE condition > > 2). SELECT agg_fn FILTER (WHERE condition) FROM ... > > I'm not a huge fan of (2), but that's the SQL standard, so we're stuck > with it. There's a certain consistency in it's use of WHERE to > introduce the condition, and preceding that with FILTER helps to > distinguish it from any later WHERE clause. But what you'd be adding > here would be a 3rd syntax > > 3). COPY ... FROM ... FILTER condition > > which IMO will just lead to confusion. > your case is for retrieving data but this is for deciding which data to insert and word FILTER I think describe it more and not lead to confusion. regards Surafel
Commits
-
Remove unused struct member, enforce multi_insert callback presence.
- 57a7a3adfe4e 12.0 landed
-
Separate per-batch and per-tuple memory contexts in COPY
- 36a1281f86c0 12.0 landed
-
Fix handling of volatile expressions in COPY FROM ... WHERE
- 4a8283d0ec5a 12.0 landed
-
Allow COPY FROM to filter data using WHERE conditions
- 31f3817402da 12.0 landed
-
Remove obsolete netbsd dynloader code
- b68ff3ea672c 12.0 cited