BUG #1437: converting column from text to int4 requires USING

From: "Kim Hansen" <k(at)oek(dot)dk>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #1437: converting column from text to int4 requires USING
Date: 2005-01-24 00:41:10
Message-ID: 200501240041.j0O0fAxr010949@developer.pgadmin.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 1437
Logged by: Kim Hansen
Email address: k(at)oek(dot)dk
PostgreSQL version: 8.0.0
Operating system: Windows
Description: converting column from text to int4 requires USING
Details:

When running the input below the 3rd line gives an error but the 4th line
works. I would expect that a::int4 was applyed by default and because of
that the USING shouldn't be nessesary.

== Input ==
CREATE TABLE test ( a text );
INSERT INTO test VALUES ( '1' );
ALTER TABLE test ALTER COLUMN a TYPE int4;
ALTER TABLE test ALTER COLUMN a TYPE int4 USING (a::int4);
DROP TABLE test;

== Output==
public=> \i bug.txt
CREATE TABLE
INSERT 25508 1
psql:bug.txt:3: ERROR: column "a" cannot be cast to type "int4"
ALTER TABLE
DROP TABLE
public=>

Browse pgsql-bugs by date

  From Date Subject
Next Message Estagus 2005-01-24 01:05:04 BUG #1438: Non UTF-8 client encoding problem
Previous Message Tom Lane 2005-01-23 20:46:36 Re: shared_buffers vs. -B flag: 7.4