Thread: pgsql 7.1: int4out() brokeness?

pgsql 7.1: int4out() brokeness?

From
James Troup
Date:
============================================================================
                        POSTGRESQL BUG REPORT TEMPLATE
============================================================================


Your name               : James Troup
Your email address      : james@nocrew.org


System Configuration
---------------------
  Architecture (example: Intel Pentium)         : Intel Pentium

  Operating System (example: Linux 2.0.26 ELF)  : Linux 2.4.0 ELF

  PostgreSQL version (example: PostgreSQL-7.0)  : PostgreSQL-7.1 snapshot (from 2001-01-07 or -08)

  Compiler used (example:  gcc 2.8.0)           : gcc 2.95.2


Please enter a FULL description of your problem:
------------------------------------------------

int4out() seems to be broken which in turn breaks ODBC.

With pgsql 7.1:

 | template1=# create table x (y int4); insert into x values (31); select y, int4out(y) from x;
 | CREATE
 | INSERT 34029 1
 |  y  |  int4out
 | ----+-----------
 |  31 | 136420312
 | (1 row)

With pgsql 7.0.3:

 | template1=> create table x (y int4); insert into x values (31); select y, int4out(y) from x;
 | CREATE
 | INSERT 35923 1
 |  y  | int4out
 | ----+---------
 |  31 | 31
 | (1 row)

Please describe a way to repeat the problem.   Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------

As above:

   CREATE TABLE x (y int4); INSERT INTO x VALUES (31); SELECT y, int4out(y) FROM x;

Both rows returned should (unless I'm missing something horribly
obvious) be 31.

If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------

--
James

Re: pgsql 7.1: int4out() brokeness?

From
Tom Lane
Date:
James Troup <james@nocrew.org> writes:
>  | template1=# create table x (y int4); insert into x values (31); select y, int4out(y) from x;
>  | CREATE
>  | INSERT 34029 1
>  |  y  |  int4out
>  | ----+-----------
>  |  31 | 136420312
>  | (1 row)

The bug here is that the system allows you to invoke int4out at all.
It should not, because int4out doesn't return a value that can be
used for computation...

> int4out() seems to be broken which in turn breaks ODBC.

ODBC is broken for having ever used it in the first place.  This error
is repaired in the 7.0.3 and 7.1 releases of ODBC, btw.

            regards, tom lane