Skip site navigation (1) Skip section navigation (2)

Re: int8 beta5 broken?

From: Olivier PRENANT <ohp(at)pyrenet(dot)fr>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Larry Rosenman <ler(at)lerctr(dot)org>
Subject: Re: int8 beta5 broken?
Date: 2001-02-28 16:44:48
Message-ID: Pine.UW2.4.21.0102281743480.10780-100000@server.pyrenet.fr (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-hackers
Sorry to follow-up on my own post; int8 test passes if open-ssl is not
used.

weird!!

Regards,
On Wed, 28 Feb 2001, Olivier PRENANT wrote:

> Hi,
> 
> Testing beta5 on unixware7 gives an error on int8 test while beta4 (I've
> just retested it) works ok regressions.diff follows:
> 
> Also, compiling with openssl give a compile error on
> src/backend/libpq/crypt.c; this error CAN be avoided by commenting out the
> definition of des_encrypt in /ur/local/ssl/include/openssl/des.h
> 
> I'm not sure this is good practice though.
> 
> Anyway, even after that, there are linking errors on libecpg.so and perl
> because of a lack of -L/usr/local/ssl/lib
> 
> Easyly avoid by setting ad hoc LD_LIBRARY_PATH.
> 
>  *** ./expected/int8.out	Mon Jan 29 03:53:58 2001
> --- ./results/int8.out	Wed Feb 28 16:29:40 2001
> ***************
> *** 5,111 ****
>   CREATE TABLE INT8_TBL(q1 int8, q2 int8);
>   INSERT INTO INT8_TBL VALUES('123','456');
>   INSERT INTO INT8_TBL VALUES('123','4567890123456789');
>   INSERT INTO INT8_TBL VALUES('4567890123456789','123');
>   INSERT INTO INT8_TBL VALUES('4567890123456789','4567890123456789');
>   INSERT INTO INT8_TBL VALUES('4567890123456789','-4567890123456789');
>   SELECT * FROM INT8_TBL;
>           q1        |        q2         
> ! ------------------+-------------------
>                 123 |               456
> !               123 |  4567890123456789
> !  4567890123456789 |               123
> !  4567890123456789 |  4567890123456789
> !  4567890123456789 | -4567890123456789
> ! (5 rows)
>   
>   SELECT '' AS five, q1 AS plus, -q1 AS minus FROM INT8_TBL;
>    five |       plus       |       minus       
> ! ------+------------------+-------------------
>         |              123 |              -123
> !       |              123 |              -123
> !       | 4567890123456789 | -4567890123456789
> !       | 4567890123456789 | -4567890123456789
> !       | 4567890123456789 | -4567890123456789
> ! (5 rows)
>   
>   SELECT '' AS five, q1, q2, q1 + q2 AS plus FROM INT8_TBL;
>    five |        q1        |        q2         |       plus       
> ! ------+------------------+-------------------+------------------
>         |              123 |               456 |              579
> !       |              123 |  4567890123456789 | 4567890123456912
> !       | 4567890123456789 |               123 | 4567890123456912
> !       | 4567890123456789 |  4567890123456789 | 9135780246913578
> !       | 4567890123456789 | -4567890123456789 |                0
> ! (5 rows)
>   
>   SELECT '' AS five, q1, q2, q1 - q2 AS minus FROM INT8_TBL;
>    five |        q1        |        q2         |       minus       
> ! ------+------------------+-------------------+-------------------
>         |              123 |               456 |              -333
> !       |              123 |  4567890123456789 | -4567890123456666
> !       | 4567890123456789 |               123 |  4567890123456666
> !       | 4567890123456789 |  4567890123456789 |                 0
> !       | 4567890123456789 | -4567890123456789 |  9135780246913578
> ! (5 rows)
>   
>   SELECT '' AS three, q1, q2, q1 * q2 AS multiply FROM INT8_TBL
>    WHERE q1 < 1000 or (q2 > 0 and q2 < 1000);
>    three |        q1        |        q2        |      multiply      
> ! -------+------------------+------------------+--------------------
>          |              123 |              456 |              56088
> !        |              123 | 4567890123456789 | 561850485185185047
> !        | 4567890123456789 |              123 | 561850485185185047
> ! (3 rows)
>   
>   SELECT '' AS five, q1, q2, q1 / q2 AS divide FROM INT8_TBL;
>    five |        q1        |        q2         |     divide     
> ! ------+------------------+-------------------+----------------
>         |              123 |               456 |              0
> !       |              123 |  4567890123456789 |              0
> !       | 4567890123456789 |               123 | 37137318076884
> !       | 4567890123456789 |  4567890123456789 |              1
> !       | 4567890123456789 | -4567890123456789 |             -1
> ! (5 rows)
>   
>   SELECT '' AS five, q1, float8(q1) FROM INT8_TBL;
>    five |        q1        |        float8        
> ! ------+------------------+----------------------
>         |              123 |                  123
> !       |              123 |                  123
> !       | 4567890123456789 | 4.56789012345679e+15
> !       | 4567890123456789 | 4.56789012345679e+15
> !       | 4567890123456789 | 4.56789012345679e+15
> ! (5 rows)
>   
>   SELECT '' AS five, q2, float8(q2) FROM INT8_TBL;
>    five |        q2         |        float8         
> ! ------+-------------------+-----------------------
>         |               456 |                   456
> !       |  4567890123456789 |  4.56789012345679e+15
> !       |               123 |                   123
> !       |  4567890123456789 |  4.56789012345679e+15
> !       | -4567890123456789 | -4.56789012345679e+15
> ! (5 rows)
>   
>   SELECT '' AS five, 2 * q1 AS "twice int4" FROM INT8_TBL;
>    five |    twice int4    
> ! ------+------------------
>         |              246
> !       |              246
> !       | 9135780246913578
> !       | 9135780246913578
> !       | 9135780246913578
> ! (5 rows)
>   
>   SELECT '' AS five, q1 * 2 AS "twice int4" FROM INT8_TBL;
>    five |    twice int4    
> ! ------+------------------
>         |              246
> !       |              246
> !       | 9135780246913578
> !       | 9135780246913578
> !       | 9135780246913578
> ! (5 rows)
>   
>   -- TO_CHAR()
>   --
> --- 5,77 ----
>   CREATE TABLE INT8_TBL(q1 int8, q2 int8);
>   INSERT INTO INT8_TBL VALUES('123','456');
>   INSERT INTO INT8_TBL VALUES('123','4567890123456789');
> + ERROR:  int8 value out of range: "4567890123456789"
>   INSERT INTO INT8_TBL VALUES('4567890123456789','123');
> + ERROR:  int8 value out of range: "4567890123456789"
>   INSERT INTO INT8_TBL VALUES('4567890123456789','4567890123456789');
> + ERROR:  int8 value out of range: "4567890123456789"
>   INSERT INTO INT8_TBL VALUES('4567890123456789','-4567890123456789');
> + ERROR:  int8 value out of range: "4567890123456789"
>   SELECT * FROM INT8_TBL;
>    q1  | q2  
> ! -----+-----
>    123 | 456
> ! (1 row)
>   
>   SELECT '' AS five, q1 AS plus, -q1 AS minus FROM INT8_TBL;
>    five | plus | minus 
> ! ------+------+-------
>         |  123 |  -123
> ! (1 row)
>   
>   SELECT '' AS five, q1, q2, q1 + q2 AS plus FROM INT8_TBL;
>    five | q1  | q2  | plus 
> ! ------+-----+-----+------
>         | 123 | 456 |  579
> ! (1 row)
>   
>   SELECT '' AS five, q1, q2, q1 - q2 AS minus FROM INT8_TBL;
>    five | q1  | q2  | minus 
> ! ------+-----+-----+-------
>         | 123 | 456 |  -333
> ! (1 row)
>   
>   SELECT '' AS three, q1, q2, q1 * q2 AS multiply FROM INT8_TBL
>    WHERE q1 < 1000 or (q2 > 0 and q2 < 1000);
>    three | q1  | q2  | multiply 
> ! -------+-----+-----+----------
>          | 123 | 456 |    56088
> ! (1 row)
>   
>   SELECT '' AS five, q1, q2, q1 / q2 AS divide FROM INT8_TBL;
>    five | q1  | q2  | divide 
> ! ------+-----+-----+--------
>         | 123 | 456 |      0
> ! (1 row)
>   
>   SELECT '' AS five, q1, float8(q1) FROM INT8_TBL;
>    five | q1  | float8 
> ! ------+-----+--------
>         | 123 |    123
> ! (1 row)
>   
>   SELECT '' AS five, q2, float8(q2) FROM INT8_TBL;
>    five | q2  | float8 
> ! ------+-----+--------
>         | 456 |    456
> ! (1 row)
>   
>   SELECT '' AS five, 2 * q1 AS "twice int4" FROM INT8_TBL;
>    five | twice int4 
> ! ------+------------
>         |        246
> ! (1 row)
>   
>   SELECT '' AS five, q1 * 2 AS "twice int4" FROM INT8_TBL;
>    five | twice int4 
> ! ------+------------
>         |        246
> ! (1 row)
>   
>   -- TO_CHAR()
>   --
> ***************
> *** 114,124 ****
>    to_char_1 |        to_char         |        to_char         
>   -----------+------------------------+------------------------
>              |                    123 |                    456
> !            |                    123 |  4,567,890,123,456,789
> !            |  4,567,890,123,456,789 |                    123
> !            |  4,567,890,123,456,789 |  4,567,890,123,456,789
> !            |  4,567,890,123,456,789 | -4,567,890,123,456,789
> ! (5 rows)
>   
>   SELECT '' AS to_char_2, to_char(q1, '9G999G999G999G999G999D999G999'), to_char(q2, '9,999,999,999,999,999.999,999') 
>   	FROM INT8_TBL;	
> --- 80,86 ----
>    to_char_1 |        to_char         |        to_char         
>   -----------+------------------------+------------------------
>              |                    123 |                    456
> ! (1 row)
>   
>   SELECT '' AS to_char_2, to_char(q1, '9G999G999G999G999G999D999G999'), to_char(q2, '9,999,999,999,999,999.999,999') 
>   	FROM INT8_TBL;	
> ***************
> *** 125,135 ****
>    to_char_2 |            to_char             |            to_char             
>   -----------+--------------------------------+--------------------------------
>              |                    123.000,000 |                    456.000,000
> !            |                    123.000,000 |  4,567,890,123,456,789.000,000
> !            |  4,567,890,123,456,789.000,000 |                    123.000,000
> !            |  4,567,890,123,456,789.000,000 |  4,567,890,123,456,789.000,000
> !            |  4,567,890,123,456,789.000,000 | -4,567,890,123,456,789.000,000
> ! (5 rows)
>   
>   SELECT '' AS to_char_3, to_char( (q1 * -1), '9999999999999999PR'), to_char( (q2 * -1), '9999999999999999.999PR') 
>   	FROM INT8_TBL;
> --- 87,93 ----
>    to_char_2 |            to_char             |            to_char             
>   -----------+--------------------------------+--------------------------------
>              |                    123.000,000 |                    456.000,000
> ! (1 row)
>   
>   SELECT '' AS to_char_3, to_char( (q1 * -1), '9999999999999999PR'), to_char( (q2 * -1), '9999999999999999.999PR') 
>   	FROM INT8_TBL;
> ***************
> *** 136,146 ****
>    to_char_3 |      to_char       |        to_char         
>   -----------+--------------------+------------------------
>              |              <123> |              <456.000>
> !            |              <123> | <4567890123456789.000>
> !            | <4567890123456789> |              <123.000>
> !            | <4567890123456789> | <4567890123456789.000>
> !            | <4567890123456789> |  4567890123456789.000
> ! (5 rows)
>   
>   SELECT '' AS to_char_4, to_char( (q1 * -1), '9999999999999999S'), to_char( (q2 * -1), 'S9999999999999999') 
>   	FROM INT8_TBL;
> --- 94,100 ----
>    to_char_3 |      to_char       |        to_char         
>   -----------+--------------------+------------------------
>              |              <123> |              <456.000>
> ! (1 row)
>   
>   SELECT '' AS to_char_4, to_char( (q1 * -1), '9999999999999999S'), to_char( (q2 * -1), 'S9999999999999999') 
>   	FROM INT8_TBL;
> ***************
> *** 147,285 ****
>    to_char_4 |      to_char      |      to_char      
>   -----------+-------------------+-------------------
>              |              123- |              -456
> !            |              123- | -4567890123456789
> !            | 4567890123456789- |              -123
> !            | 4567890123456789- | -4567890123456789
> !            | 4567890123456789- | +4567890123456789
> ! (5 rows)
>   
>   SELECT '' AS to_char_5,  to_char(q2, 'MI9999999999999999')     FROM INT8_TBL;	
>    to_char_5 |      to_char       
>   -----------+--------------------
>              |                456
> !            |   4567890123456789
> !            |                123
> !            |   4567890123456789
> !            | -4567890123456789
> ! (5 rows)
>   
>   SELECT '' AS to_char_6,  to_char(q2, 'FMS9999999999999999')    FROM INT8_TBL;
>    to_char_6 |      to_char      
> ! -----------+-------------------
>              | +456
> !            | +4567890123456789
> !            | +123
> !            | +4567890123456789
> !            | -4567890123456789
> ! (5 rows)
>   
>   SELECT '' AS to_char_7,  to_char(q2, 'FM9999999999999999THPR') FROM INT8_TBL;
>    to_char_7 |      to_char       
> ! -----------+--------------------
>              | 456TH
> !            | 4567890123456789TH
> !            | 123RD
> !            | 4567890123456789TH
> !            | <4567890123456789>
> ! (5 rows)
>   
>   SELECT '' AS to_char_8,  to_char(q2, 'SG9999999999999999th')   FROM INT8_TBL;	
>    to_char_8 |       to_char       
>   -----------+---------------------
>              | +             456th
> !            | +4567890123456789th
> !            | +             123rd
> !            | +4567890123456789th
> !            | -4567890123456789
> ! (5 rows)
>   
>   SELECT '' AS to_char_9,  to_char(q2, '0999999999999999')       FROM INT8_TBL;	
>    to_char_9 |      to_char      
>   -----------+-------------------
>              |  0000000000000456
> !            |  4567890123456789
> !            |  0000000000000123
> !            |  4567890123456789
> !            | -4567890123456789
> ! (5 rows)
>   
>   SELECT '' AS to_char_10, to_char(q2, 'S0999999999999999')      FROM INT8_TBL;	
>    to_char_10 |      to_char      
>   ------------+-------------------
>               | +0000000000000456
> !             | +4567890123456789
> !             | +0000000000000123
> !             | +4567890123456789
> !             | -4567890123456789
> ! (5 rows)
>   
>   SELECT '' AS to_char_11, to_char(q2, 'FM0999999999999999')     FROM INT8_TBL;	
>    to_char_11 |      to_char      
> ! ------------+-------------------
>               | 0000000000000456
> !             | 4567890123456789
> !             | 0000000000000123
> !             | 4567890123456789
> !             | -4567890123456789
> ! (5 rows)
>   
>   SELECT '' AS to_char_12, to_char(q2, 'FM9999999999999999.000') FROM INT8_TBL;
>    to_char_12 |        to_char        
> ! ------------+-----------------------
>               | 456.000
> !             | 4567890123456789.000
> !             | 123.000
> !             | 4567890123456789.000
> !             | -4567890123456789.000
> ! (5 rows)
>   
>   SELECT '' AS to_char_13, to_char(q2, 'L9999999999999999.000')  FROM INT8_TBL;	
>    to_char_13 |        to_char         
>   ------------+------------------------
>               |                456.000
> !             |   4567890123456789.000
> !             |                123.000
> !             |   4567890123456789.000
> !             |  -4567890123456789.000
> ! (5 rows)
>   
>   SELECT '' AS to_char_14, to_char(q2, 'FM9999999999999999.999') FROM INT8_TBL;
>    to_char_14 |      to_char      
> ! ------------+-------------------
>               | 456
> !             | 4567890123456789
> !             | 123
> !             | 4567890123456789
> !             | -4567890123456789
> ! (5 rows)
>   
>   SELECT '' AS to_char_15, to_char(q2, 'S 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9') FROM INT8_TBL;
>    to_char_15 |                  to_char                  
>   ------------+-------------------------------------------
>               |                           +4 5 6 . 0 0 0 
> !             | + 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 . 0 0 0
> !             |                           +1 2 3 . 0 0 0 
> !             | + 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 . 0 0 0
> !             | - 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 . 0 0 0
> ! (5 rows)
>   
>   SELECT '' AS to_char_16, to_char(q2, '99999 "text" 9999 "9999" 999 "\\"text between quote marks\\"" 9999') FROM INT8_TBL;
>    to_char_16 |                          to_char                          
>   ------------+-----------------------------------------------------------
>               |       text      9999     "text between quote marks"   456
> !             |  45678 text 9012 9999 345 "text between quote marks" 6789
> !             |       text      9999     "text between quote marks"   123
> !             |  45678 text 9012 9999 345 "text between quote marks" 6789
> !             | -45678 text 9012 9999 345 "text between quote marks" 6789
> ! (5 rows)
>   
>   SELECT '' AS to_char_17, to_char(q2, '999999SG9999999999')     FROM INT8_TBL;
>    to_char_17 |      to_char      
>   ------------+-------------------
>               |       +       456
> !             | 456789+0123456789
> !             |       +       123
> !             | 456789+0123456789
> !             | 456789-0123456789
> ! (5 rows)
>   
> --- 101,183 ----
>    to_char_4 |      to_char      |      to_char      
>   -----------+-------------------+-------------------
>              |              123- |              -456
> ! (1 row)
>   
>   SELECT '' AS to_char_5,  to_char(q2, 'MI9999999999999999')     FROM INT8_TBL;	
>    to_char_5 |      to_char       
>   -----------+--------------------
>              |                456
> ! (1 row)
>   
>   SELECT '' AS to_char_6,  to_char(q2, 'FMS9999999999999999')    FROM INT8_TBL;
>    to_char_6 | to_char 
> ! -----------+---------
>              | +456
> ! (1 row)
>   
>   SELECT '' AS to_char_7,  to_char(q2, 'FM9999999999999999THPR') FROM INT8_TBL;
>    to_char_7 | to_char 
> ! -----------+---------
>              | 456TH
> ! (1 row)
>   
>   SELECT '' AS to_char_8,  to_char(q2, 'SG9999999999999999th')   FROM INT8_TBL;	
>    to_char_8 |       to_char       
>   -----------+---------------------
>              | +             456th
> ! (1 row)
>   
>   SELECT '' AS to_char_9,  to_char(q2, '0999999999999999')       FROM INT8_TBL;	
>    to_char_9 |      to_char      
>   -----------+-------------------
>              |  0000000000000456
> ! (1 row)
>   
>   SELECT '' AS to_char_10, to_char(q2, 'S0999999999999999')      FROM INT8_TBL;	
>    to_char_10 |      to_char      
>   ------------+-------------------
>               | +0000000000000456
> ! (1 row)
>   
>   SELECT '' AS to_char_11, to_char(q2, 'FM0999999999999999')     FROM INT8_TBL;	
>    to_char_11 |     to_char      
> ! ------------+------------------
>               | 0000000000000456
> ! (1 row)
>   
>   SELECT '' AS to_char_12, to_char(q2, 'FM9999999999999999.000') FROM INT8_TBL;
>    to_char_12 | to_char 
> ! ------------+---------
>               | 456.000
> ! (1 row)
>   
>   SELECT '' AS to_char_13, to_char(q2, 'L9999999999999999.000')  FROM INT8_TBL;	
>    to_char_13 |        to_char         
>   ------------+------------------------
>               |                456.000
> ! (1 row)
>   
>   SELECT '' AS to_char_14, to_char(q2, 'FM9999999999999999.999') FROM INT8_TBL;
>    to_char_14 | to_char 
> ! ------------+---------
>               | 456
> ! (1 row)
>   
>   SELECT '' AS to_char_15, to_char(q2, 'S 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9') FROM INT8_TBL;
>    to_char_15 |                  to_char                  
>   ------------+-------------------------------------------
>               |                           +4 5 6 . 0 0 0 
> ! (1 row)
>   
>   SELECT '' AS to_char_16, to_char(q2, '99999 "text" 9999 "9999" 999 "\\"text between quote marks\\"" 9999') FROM INT8_TBL;
>    to_char_16 |                          to_char                          
>   ------------+-----------------------------------------------------------
>               |       text      9999     "text between quote marks"   456
> ! (1 row)
>   
>   SELECT '' AS to_char_17, to_char(q2, '999999SG9999999999')     FROM INT8_TBL;
>    to_char_17 |      to_char      
>   ------------+-------------------
>               |       +       456
> ! (1 row)
>   
> 
> ======================================================================
> 
> *** ./expected/subselect.out	Thu Mar 23 08:42:13 2000
> --- ./results/subselect.out	Wed Feb 28 16:35:21 2001
> ***************
> *** 160,167 ****
>   select q1, float8(count(*)) / (select count(*) from int8_tbl)
>   from int8_tbl group by q1;
>           q1        | ?column? 
> ! ------------------+----------
> !               123 |      0.4
> !  4567890123456789 |      0.6
> ! (2 rows)
>   
> --- 160,166 ----
>   select q1, float8(count(*)) / (select count(*) from int8_tbl)
>   from int8_tbl group by q1;
>    q1  | ?column? 
> ! -----+----------
> !  123 |        1
> ! (1 row)
>   
> 
> ======================================================================
> 
> *** ./expected/union.out	Thu Nov  9 03:47:49 2000
> --- ./results/union.out	Wed Feb 28 16:35:22 2001
> ***************
> *** 259,318 ****
>   --
>   SELECT q2 FROM int8_tbl INTERSECT SELECT q1 FROM int8_tbl;
>           q2        
> ! ------------------
> !               123
> !  4567890123456789
> ! (2 rows)
>   
>   SELECT q2 FROM int8_tbl INTERSECT ALL SELECT q1 FROM int8_tbl;
>           q2        
> ! ------------------
> !               123
> !  4567890123456789
> !  4567890123456789
> ! (3 rows)
>   
>   SELECT q2 FROM int8_tbl EXCEPT SELECT q1 FROM int8_tbl;
>           q2         
> ! -------------------
> !  -4567890123456789
>                  456
> ! (2 rows)
>   
>   SELECT q2 FROM int8_tbl EXCEPT ALL SELECT q1 FROM int8_tbl;
>           q2         
> ! -------------------
> !  -4567890123456789
>                  456
> ! (2 rows)
>   
>   SELECT q2 FROM int8_tbl EXCEPT ALL SELECT DISTINCT q1 FROM int8_tbl;
>           q2         
> ! -------------------
> !  -4567890123456789
>                  456
> !   4567890123456789
> ! (3 rows)
>   
>   SELECT q1 FROM int8_tbl EXCEPT SELECT q2 FROM int8_tbl;
>    q1 
> ! ----
> ! (0 rows)
>   
>   SELECT q1 FROM int8_tbl EXCEPT ALL SELECT q2 FROM int8_tbl;
>           q1        
> ! ------------------
>                 123
> !  4567890123456789
> ! (2 rows)
>   
>   SELECT q1 FROM int8_tbl EXCEPT ALL SELECT DISTINCT q2 FROM int8_tbl;
>           q1        
> ! ------------------
>                 123
> !  4567890123456789
> !  4567890123456789
> ! (3 rows)
>   
>   --
>   -- Mixed types
> --- 259,307 ----
>   --
>   SELECT q2 FROM int8_tbl INTERSECT SELECT q1 FROM int8_tbl;
>    q2 
> ! ----
> ! (0 rows)
>   
>   SELECT q2 FROM int8_tbl INTERSECT ALL SELECT q1 FROM int8_tbl;
>    q2 
> ! ----
> ! (0 rows)
>   
>   SELECT q2 FROM int8_tbl EXCEPT SELECT q1 FROM int8_tbl;
>    q2  
> ! -----
>    456
> ! (1 row)
>   
>   SELECT q2 FROM int8_tbl EXCEPT ALL SELECT q1 FROM int8_tbl;
>    q2  
> ! -----
>    456
> ! (1 row)
>   
>   SELECT q2 FROM int8_tbl EXCEPT ALL SELECT DISTINCT q1 FROM int8_tbl;
>    q2  
> ! -----
>    456
> ! (1 row)
>   
>   SELECT q1 FROM int8_tbl EXCEPT SELECT q2 FROM int8_tbl;
>    q1  
> ! -----
> !  123
> ! (1 row)
>   
>   SELECT q1 FROM int8_tbl EXCEPT ALL SELECT q2 FROM int8_tbl;
>    q1  
> ! -----
>    123
> ! (1 row)
>   
>   SELECT q1 FROM int8_tbl EXCEPT ALL SELECT DISTINCT q2 FROM int8_tbl;
>    q1  
> ! -----
>    123
> ! (1 row)
>   
>   --
>   -- Mixed types
> ***************
> *** 337,396 ****
>   --
>   SELECT q1 FROM int8_tbl INTERSECT SELECT q2 FROM int8_tbl UNION ALL SELECT q2 FROM int8_tbl;
>           q1         
> ! -------------------
> !                123
> !   4567890123456789
>                  456
> !   4567890123456789
> !                123
> !   4567890123456789
> !  -4567890123456789
> ! (7 rows)
>   
>   SELECT q1 FROM int8_tbl INTERSECT (((SELECT q2 FROM int8_tbl UNION ALL SELECT q2 FROM int8_tbl)));
>           q1        
> ! ------------------
> !               123
> !  4567890123456789
> ! (2 rows)
>   
>   (((SELECT q1 FROM int8_tbl INTERSECT SELECT q2 FROM int8_tbl))) UNION ALL SELECT q2 FROM int8_tbl;
>           q1         
> ! -------------------
> !                123
> !   4567890123456789
>                  456
> !   4567890123456789
> !                123
> !   4567890123456789
> !  -4567890123456789
> ! (7 rows)
>   
>   SELECT q1 FROM int8_tbl UNION ALL SELECT q2 FROM int8_tbl EXCEPT SELECT q1 FROM int8_tbl;
>           q1         
> ! -------------------
> !  -4567890123456789
>                  456
> ! (2 rows)
>   
>   SELECT q1 FROM int8_tbl UNION ALL (((SELECT q2 FROM int8_tbl EXCEPT SELECT q1 FROM int8_tbl)));
>           q1         
> ! -------------------
>                  123
> -                123
> -   4567890123456789
> -   4567890123456789
> -   4567890123456789
> -  -4567890123456789
>                  456
> ! (7 rows)
>   
>   (((SELECT q1 FROM int8_tbl UNION ALL SELECT q2 FROM int8_tbl))) EXCEPT SELECT q1 FROM int8_tbl;
>           q1         
> ! -------------------
> !  -4567890123456789
>                  456
> ! (2 rows)
>   
>   --
>   -- Subqueries with ORDER BY & LIMIT clauses
> --- 326,364 ----
>   --
>   SELECT q1 FROM int8_tbl INTERSECT SELECT q2 FROM int8_tbl UNION ALL SELECT q2 FROM int8_tbl;
>    q1  
> ! -----
>    456
> ! (1 row)
>   
>   SELECT q1 FROM int8_tbl INTERSECT (((SELECT q2 FROM int8_tbl UNION ALL SELECT q2 FROM int8_tbl)));
>    q1 
> ! ----
> ! (0 rows)
>   
>   (((SELECT q1 FROM int8_tbl INTERSECT SELECT q2 FROM int8_tbl))) UNION ALL SELECT q2 FROM int8_tbl;
>    q1  
> ! -----
>    456
> ! (1 row)
>   
>   SELECT q1 FROM int8_tbl UNION ALL SELECT q2 FROM int8_tbl EXCEPT SELECT q1 FROM int8_tbl;
>    q1  
> ! -----
>    456
> ! (1 row)
>   
>   SELECT q1 FROM int8_tbl UNION ALL (((SELECT q2 FROM int8_tbl EXCEPT SELECT q1 FROM int8_tbl)));
>    q1  
> ! -----
>    123
>    456
> ! (2 rows)
>   
>   (((SELECT q1 FROM int8_tbl UNION ALL SELECT q2 FROM int8_tbl))) EXCEPT SELECT q1 FROM int8_tbl;
>    q1  
> ! -----
>    456
> ! (1 row)
>   
>   --
>   -- Subqueries with ORDER BY & LIMIT clauses
> ***************
> *** 399,408 ****
>   SELECT q1,q2 FROM int8_tbl EXCEPT SELECT q2,q1 FROM int8_tbl
>   ORDER BY q2,q1;
>           q1        |        q2         
> ! ------------------+-------------------
> !  4567890123456789 | -4567890123456789
>                 123 |               456
> ! (2 rows)
>   
>   -- This should fail, because q2 isn't a name of an EXCEPT output column
>   SELECT q1 FROM int8_tbl EXCEPT SELECT q2 FROM int8_tbl ORDER BY q2 LIMIT 1;
> --- 367,375 ----
>   SELECT q1,q2 FROM int8_tbl EXCEPT SELECT q2,q1 FROM int8_tbl
>   ORDER BY q2,q1;
>    q1  | q2  
> ! -----+-----
>    123 | 456
> ! (1 row)
>   
>   -- This should fail, because q2 isn't a name of an EXCEPT output column
>   SELECT q1 FROM int8_tbl EXCEPT SELECT q2 FROM int8_tbl ORDER BY q2 LIMIT 1;
> ***************
> *** 410,419 ****
>   -- But this should work:
>   SELECT q1 FROM int8_tbl EXCEPT (((SELECT q2 FROM int8_tbl ORDER BY q2 LIMIT 1)));
>           q1        
> ! ------------------
>                 123
> !  4567890123456789
> ! (2 rows)
>   
>   --
>   -- New syntaxes (7.1) permit new tests
> --- 377,385 ----
>   -- But this should work:
>   SELECT q1 FROM int8_tbl EXCEPT (((SELECT q2 FROM int8_tbl ORDER BY q2 LIMIT 1)));
>    q1  
> ! -----
>    123
> ! (1 row)
>   
>   --
>   -- New syntaxes (7.1) permit new tests
> ***************
> *** 420,430 ****
>   --
>   (((((select * from int8_tbl)))));
>           q1        |        q2         
> ! ------------------+-------------------
>                 123 |               456
> !               123 |  4567890123456789
> !  4567890123456789 |               123
> !  4567890123456789 |  4567890123456789
> !  4567890123456789 | -4567890123456789
> ! (5 rows)
>   
> --- 386,392 ----
>   --
>   (((((select * from int8_tbl)))));
>    q1  | q2  
> ! -----+-----
>    123 | 456
> ! (1 row)
>   
> 
> ======================================================================
> 
> 
> 

-- 
Olivier PRENANT         	Tel:	+33-5-61-50-97-00 (Work)
Quartier d'Harraud Turrou           +33-5-61-50-97-01 (Fax)
31190 AUTERIVE                      +33-6-07-63-80-64 (GSM)
FRANCE                      Email: ohp(at)pyrenet(dot)fr
------------------------------------------------------------------------------
Make your life a dream, make your dream a reality. (St Exupery)


In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2001-02-28 16:53:55
Subject: Re: [HACKERS] int8 beta5 broken?
Previous:From: Olivier PRENANTDate: 2001-02-28 16:04:51
Subject: int8 beta5 broken?

pgsql-bugs by date

Next:From: Tom LaneDate: 2001-02-28 16:53:55
Subject: Re: [HACKERS] int8 beta5 broken?
Previous:From: Olivier PRENANTDate: 2001-02-28 16:04:51
Subject: int8 beta5 broken?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group