Re: [GENERAL] is (not) distinct from

2017-03-07 Thread Adrian Klaver
On 03/07/2017 01:22 AM, Johann Spies wrote: Thanks (again Adrian) and Tom. The situation was that I had a table with 731million records which I wanted to copy into a partitioned one where there was a unique constraint on the fields used in my query. The "backup" table was the single one. While

Re: [GENERAL] is (not) distinct from

2017-03-07 Thread Johann Spies
Thanks (again Adrian) and Tom. The situation was that I had a table with 731million records which I wanted to copy into a partitioned one where there was a unique constraint on the fields used in my query. The "backup" table was the single one. While inserting into the partitioned table from the

Re: [GENERAL] is (not) distinct from

2017-03-01 Thread Tom Lane
Adrian Klaver writes: > Where I am going with this, is that it is not clear to me how you are > matching the two sets of records to determine whether they are different > or not. He's not. The query is forming the cartesian product of the two tables and then dropping join rows where the tables

Re: [GENERAL] is (not) distinct from

2017-03-01 Thread Adrian Klaver
On 03/01/2017 12:15 AM, Johann Spies wrote: On 28 February 2017 at 17:06, Adrian Klaver mailto:adrian.kla...@aklaver.com>> wrote: I have not worked through all this but at first glance I suspect: select distinct b.* from b ... is distinct from ... constitutes a double negativ

Re: [GENERAL] is (not) distinct from

2017-03-01 Thread Johann Spies
On 28 February 2017 at 17:06, Adrian Klaver wrote: > > I have not worked through all this but at first glance I suspect: > > select distinct b.* from b ... > > is distinct from ... > > constitutes a double negative. > > What happens if you eliminate the first distinct? > > > > Thanks Adrian, The

Re: [GENERAL] is (not) distinct from

2017-02-28 Thread Adrian Klaver
On 02/28/2017 12:08 AM, Johann Spies wrote: When I query table a I get 18 rows. The same query on table b results in 28 rows. Both tables have the same structure. When I export the results to csv-files and do a diff it confirms that all 18 rows from a are also in b. Table b has 10 new rows. Wh

[GENERAL] is (not) distinct from

2017-02-28 Thread Johann Spies
When I query table a I get 18 rows. The same query on table b results in 28 rows. Both tables have the same structure. When I export the results to csv-files and do a diff it confirms that all 18 rows from a are also in b. Table b has 10 new rows. When I combine these queries and use "is (not) d

Re: [GENERAL] is not distinct from any(...)

2008-09-19 Thread Tom Lane
"Robert Haas" <[EMAIL PROTECTED]> writes: > That doesn't seem to work, because IS NOT DISTINCT FROM is not an > operator. Yah :-( > So then I tried creating an operator === (anyelement, > anyelement) that just does IS NOT DISTINCT FROM and writing: > select 1 === any(array[1]); > which got me: >

[GENERAL] is not distinct from any(...)

2008-09-19 Thread Robert Haas
I'm trying to write a SQL statement to determine whether a value is an an array, but I want the comparison to be done using IS NOT DISTINCT FROM rather than =. My first thought was that instead of writing: SELECT value = ANY(array) ...I could simply write: SELECT value IS NOT DISTINCT FROM ANY(