From riho@centrum.ee Tue Aug 29 08:32:26 2006 X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id EE2E59FB1EE for ; Tue, 29 Aug 2006 05:32:26 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 90060-02 for ; Tue, 29 Aug 2006 08:32:18 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.neti.ee (smtp-out-1.neti.ee [194.126.101.98]) by postgresql.org (Postfix) with ESMTP id 06DD59FB1FC for ; Tue, 29 Aug 2006 05:32:17 -0300 (ADT) Received: from Maisa (217-159-248-6-dsl.mus.estpak.ee [217.159.248.6]) by Relayhost2.neti.ee (Postfix) with SMTP id 3FA1217438 for ; Tue, 29 Aug 2006 11:32:15 +0300 (EEST) Message-ID: <00ec01c6cb45$ae19dbb0$6607a8c0@Maisa> From: "Riho Maisa" To: Subject: Inserting bit-type value into integer-type column Date: Tue, 29 Aug 2006 11:32:35 +0300 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_00E9_01C6CB5E.D3518FE0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2869 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 X-Virus-Scanned: by amavisd-new-2.2.1 (20041222) (Debian) at neti.ee X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.27 tagged_above=0 required=5 tests=FORGED_RCVD_HELO, HTML_50_60, HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200608/312 X-Sequence-Number: 22855 This is a multi-part message in MIME format. ------=_NextPart_000_00E9_01C6CB5E.D3518FE0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi! I have quite strange situation (at least for me). In one older server I = have debian Woody and postgresql version shows "PostgreSQL 7.2.1 on = i686-pc-linux-gnu, compiled by GCC 2.95.4". The server is not installed = by me. I built new server, debian Sarge with default Postgresql from package: = PostgreSQL 7.4.7 on i386-pc-linux-gnu, compiled by GCC i386-linux-gcc = (GCC) 3.3.5 (Debian 1:3.3.5-12) I create database and a table: CREATE TABLE test (id integer, id2 = integer); I have SQL sentence: INSERT INTO test VALUES (x'0121', 7) (yes, type = BIT into INTEGER column) The anomaly for me: in 7.2 it works, but in 7.4 it doesn't. I cannot = rewrite SQL INSERT because it's in compiled application. Could anybody say how it is possible and is there any way to get the = same sql working in my newer server using PostgreSQL 7.4? It seems for = me as a configuration issue. Riho ------=_NextPart_000_00E9_01C6CB5E.D3518FE0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi!
 
I have quite strange situation (at = least for me).=20 In one older server I have debian Woody and postgresql version shows = "PostgreSQL=20 7.2.1 on i686-pc-linux-gnu, compiled by GCC 2.95.4". The server is not = installed=20 by me.
 
I built new server, debian Sarge with = default=20 Postgresql from package: PostgreSQL 7.4.7 on i386-pc-linux-gnu, compiled = by GCC=20 i386-linux-gcc (GCC) 3.3.5 (Debian 1:3.3.5-12)
 
I create database and a = table: CREATE=20 TABLE test (id integer, id2 integer);
 
I have SQL sentence: INSERT INTO test = VALUES=20 (x'0121', 7)  (yes, type BIT into INTEGER column)
 
The anomaly for me: in 7.2 it works, = but in 7.4 it=20 doesn't. I cannot rewrite SQL INSERT because it's in compiled=20 application.
 
Could anybody say how it is possible = and is there=20 any way to get the same sql working in my newer server using PostgreSQL = 7.4? It=20 seems for me as a configuration issue.
 
  = Riho
------=_NextPart_000_00E9_01C6CB5E.D3518FE0-- From peter_e@gmx.net Tue Aug 29 08:44:41 2006 X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 504B79FB1FC for ; Tue, 29 Aug 2006 05:44:41 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 78678-07 for ; Tue, 29 Aug 2006 08:44:40 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from gauss.credativ.com (ipx11302.ipxserver.de [212.112.227.254]) by postgresql.org (Postfix) with ESMTP id 9E0B29FB1EE for ; Tue, 29 Aug 2006 05:44:40 -0300 (ADT) Received: from bell.credativ.de (p508959B7.dip.t-dialin.net [80.137.89.183]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by gauss.credativ.com (Postfix) with ESMTP id A850BD792B; Tue, 29 Aug 2006 10:44:38 +0200 (CEST) From: Peter Eisentraut To: pgsql-admin@postgresql.org Subject: Re: Inserting bit-type value into integer-type column Date: Tue, 29 Aug 2006 10:44:29 +0200 User-Agent: KMail/1.9.3 Cc: "Riho Maisa" References: <00ec01c6cb45$ae19dbb0$6607a8c0@Maisa> In-Reply-To: <00ec01c6cb45$ae19dbb0$6607a8c0@Maisa> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200608291044.31542.peter_e@gmx.net> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200608/313 X-Sequence-Number: 22856 Am Dienstag, 29. August 2006 10:32 schrieb Riho Maisa: > The anomaly for me: in 7.2 it works, but in 7.4 it doesn't. 7.2 was wrong to accept such things; 7.4 fixed it. > I cannot rewrite SQL INSERT because it's in compiled application. Either fix your application or patch the PostgreSQL server or stick with 7.2 (not recommended, because 7.2 is not maintained anymore). -- Peter Eisentraut http://developer.postgresql.org/~petere/ From tgl@sss.pgh.pa.us Tue Aug 29 13:03:31 2006 X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 5C1329FB232 for ; Tue, 29 Aug 2006 10:03:31 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 70234-07 for ; Tue, 29 Aug 2006 13:03:26 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 3D0129FB227 for ; Tue, 29 Aug 2006 10:03:26 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k7TD3HKb003210; Tue, 29 Aug 2006 09:03:17 -0400 (EDT) To: Peter Eisentraut cc: pgsql-admin@postgresql.org, "Riho Maisa" Subject: Re: Inserting bit-type value into integer-type column In-reply-to: <200608291044.31542.peter_e@gmx.net> References: <00ec01c6cb45$ae19dbb0$6607a8c0@Maisa> <200608291044.31542.peter_e@gmx.net> Comments: In-reply-to Peter Eisentraut message dated "Tue, 29 Aug 2006 10:44:29 +0200" Date: Tue, 29 Aug 2006 09:03:17 -0400 Message-ID: <3209.1156856597@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200608/314 X-Sequence-Number: 22857 Peter Eisentraut writes: > Am Dienstag, 29. August 2006 10:32 schrieb Riho Maisa: >> I cannot rewrite SQL INSERT because it's in compiled application. > Either fix your application or patch the PostgreSQL server or stick with 7.2 > (not recommended, because 7.2 is not maintained anymore). The patch would be pretty easy though: just tweak the pg_cast entry for bit to int casting so that it's "assignment" rather than "explicit". regards, tom lane