pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Inserting bit-type value into integer-type column
3+ messages / 3 participants
[nested] [flat]

* Inserting bit-type value into integer-type column
@ 2006-08-29 08:32 Riho Maisa <riho@centrum.ee>
  2006-08-29 08:44 ` Re: Inserting bit-type value into integer-type column Peter Eisentraut <peter_e@gmx.net>
  0 siblings, 1 reply; 3+ messages in thread

From: Riho Maisa @ 2006-08-29 08:32 UTC (permalink / raw)
  To: pgsql-admin

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

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Inserting bit-type value into integer-type column
  2006-08-29 08:32 Inserting bit-type value into integer-type column Riho Maisa <riho@centrum.ee>
@ 2006-08-29 08:44 ` Peter Eisentraut <peter_e@gmx.net>
  2006-08-29 13:03   ` Re: Inserting bit-type value into integer-type column Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: Peter Eisentraut @ 2006-08-29 08:44 UTC (permalink / raw)
  To: pgsql-admin; +Cc: Riho Maisa <riho@centrum.ee>

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/



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Inserting bit-type value into integer-type column
  2006-08-29 08:32 Inserting bit-type value into integer-type column Riho Maisa <riho@centrum.ee>
  2006-08-29 08:44 ` Re: Inserting bit-type value into integer-type column Peter Eisentraut <peter_e@gmx.net>
@ 2006-08-29 13:03   ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2006-08-29 13:03 UTC (permalink / raw)
  To: Peter Eisentraut <peter_e@gmx.net>; +Cc: pgsql-admin@postgresql.org, "Riho Maisa" <riho@centrum.ee>

Peter Eisentraut <peter_e@gmx.net> 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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2006-08-29 13:03 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-08-29 08:32 Inserting bit-type value into integer-type column Riho Maisa <riho@centrum.ee>
2006-08-29 08:44 ` Peter Eisentraut <peter_e@gmx.net>
2006-08-29 13:03   ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox