X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id AF39255818 for ; Sat, 5 Mar 2005 15:35:29 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 74458-04 for ; Sat, 5 Mar 2005 15:35:26 +0000 (GMT) Received: from mx01.asacom.de (shellsystem.de [62.216.184.150]) by svr1.postgresql.org (Postfix) with ESMTP id 9C04255773 for ; Sat, 5 Mar 2005 15:35:23 +0000 (GMT) Received: from localhost (localhost [127.0.0.1]) by mx01.asacom.de (mx01.asacom.de) with ESMTP id 65E886EC375 for ; Sat, 5 Mar 2005 16:35:25 +0100 (CET) Received: from mx01.asacom.de ([127.0.0.1]) by localhost (digi1 [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 11379-03 for ; Sat, 5 Mar 2005 16:35:25 +0100 (CET) Received: by mx01.asacom.de (mx01.asacom.de, from userid 33) id 2C94A6EC374; Sat, 5 Mar 2005 16:35:25 +0100 (CET) To: pgsql-odbc@postgresql.org Subject: Error when inserting data From: postgresql@thomasbache.de X-Priority: 3 Importance: Normal X-MSMail-Priority: Normal X-MimeOLE: Produced by Confixx WebMail X-Mailer: Confixx WebMail (like SquirrelMail) Cc: Content-Type: text/plain Content-Transfer-Encoding: 8bit Message-Id: <20050305153525.2C94A6EC374@mx01.asacom.de> Date: Sat, 5 Mar 2005 16:35:25 +0100 (CET) X-Virus-Scanned: by amavisd-new-20030616-p3 (Debian) at mx01.asacom.de X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.203 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO, NO_REAL_NAME X-Spam-Level: X-Archive-Number: 200503/27 X-Sequence-Number: 5045 Hi folks! I just found a strange thing in pg8.0.1. I have a table called Anwesenheit with an int4-field called TeilnehmerID, wich is constrained to another tables primary key. Now when I try to insert data into the table, pg throws an error. It looks like that: query: INSERT INTO "Anwesenheit" ("TeilnehmerID", "Monat", "Jahr") VALUES (-1324054016, 9, 2003); errorlog: ERROR: 22003: integer out of range LOCATION: int84, int8.c:947 STATEMENT: INSERT INTO "Anwesenheit" ("TeilnehmerID", "Monat", "Jahr") VALUES (-1324054016, 9, 2003); The interesting part of the table-definition is CREATE TABLE "Anwesenheit" ( "lID" int4 NOT NULL DEFAULT nextval('Anwesenheit_s'::text), "TeilnehmerID" int4 DEFAULT 0, "Monat" int4 DEFAULT date_part('month'::text, (now())::timestamp without time zone), "Jahr" int4 DEFAULT date_part('year'::text, (now())::timestamp without time zone), [...], CONSTRAINT a_pk PRIMARY KEY ("lID"), CONSTRAINT fk FOREIGN KEY ("TeilnehmerID") REFERENCES "Teilnehmer" ("ID") ON UPDATE CASCADE ON DELETE CASCADE ) WITH OIDS; I'm puzzled, because the integervalue is accepted as int4 by pg: data=# SELECT (-1324054016)::int4; int4 ------------- -1324054016 (1 row) I use this insert-statement via odbc in my access-app. The error also occurs, when I connect directly to the database. Any ideas are welcome! Thanks, Thomas Bache