alamb commented on pull request #9596:
URL: https://github.com/apache/arrow/pull/9596#issuecomment-788171536


   I just tried a quick test on postgres which I think says postgres doesn't 
upcast integer types
   
   ```
   alamb=# create table foo (x smallint);
   CREATE TABLE
   alamb=# create table bar as select x * x from foo;
   SELECT 0
   alamb=# \d bar
                     Table "public.bar"
     Column  |   Type   | Collation | Nullable | Default 
   ----------+----------+-----------+----------+---------
    ?column? | smallint |           |          | 
   
   alamb=# 
   ```
   
   If a calculation overflows the maximum value of a `smallint`, postgres 
produces a runtime error rather than automatically upcasing:
   
   ```
   alamb=# insert into foo values (32767);
   INSERT 0 1
   alamb=# select x + x from foo;
   ERROR:  smallint out of range
   alamb=# 
   ```


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to