Re: bigint our 4 bytes?

Andreas Kretschmer <[email protected]> Sun, 29 Nov 2015 16:49:35 +0100
Newsgroups gmane.comp.db.postgresql.german
Message-ID <20151129154935.GA29924@tux>
Charlie Schaubmair <[email protected]> wrote:

> Hallo,
> 
> Meine Installation auf OS X ist:
> 9.4.4
> 
> Folgende Tabelle mit Insert scheint leider kein bigint, sondern lediglich ein
> integer mit 4 bytes zu sein:
> CREATE TABLE public.test_big_integer (
> id bigint  NULL
> );
> 
> INSERT INTO test_big_integer (id) VALUES (3968832031);
> 
> SELECT * FROM test_big_integer;
> —> 2147483647


test=*# CREATE TABLE public.test_big_integer (
test(# id bigint  NULL
test(# );
CREATE TABLE
test=*#
test=*# INSERT INTO test_big_integer (id) VALUES (3968832031);
INSERT 0 1
test=*#
test=*# SELECT * FROM test_big_integer;
     id
------------
 3968832031
(1 row)




> 
> Es scheint also so, als ob meine installation den Typ "bigint" auch auf 4 bytes
> beschränkt hat und nicht wie eigentlich auf 8 bytes.
> 
> Ich bin gerade dabei von MySQL zu PostgreSQL zu wechseln und wundere mich ob
> ich da eventuell bei der Installation/Konfiguration einen Fehler gemacht habe?
> 
> Getestet mit folgenden clients:
> SQLPro for Postgres Version 1.0.12
> IntelliJ IDEA 15

Probiere es ZUERST mal in psql. Du wirst sehe: da wird es klappen. Das
Problem scheint beim Client zu liegen. Ändere Dein Insert mal zu:

INSERT INTO test_big_integer (id) VALUES (3968832031::bigint);

vielleicht hilft das schon. Wie gesagt: den Murks macht Dein Client. Hab
erst vor 2 Tagen bei der pgconf.de ein ähnliches Beispiel gehört.


Andreas
-- 
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°


-- 
Sent via pgsql-de-allgemein mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-de-allgemein