BUG #13919: Cast error when table is empty.

From: mail(at)eaden(dot)net
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #13919: Cast error when table is empty.
Date: 2016-02-05 11:35:28
Message-ID: 20160205113528.2660.62254@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 13919
Logged by: Eaden McKee
Email address: mail(at)eaden(dot)net
PostgreSQL version: 9.4.1
Operating system: Any
Description:

When trying to change the type of column I received the error :

PG::DatatypeMismatch: ERROR: column "date_of_birth" cannot be cast
automatically to type date
HINT: Specify a USING expression to perform the conversion.

I totally understand the error. However, there are no rows in the table, so
it IS possible to automatically to cast 0 strings into 0 dates.

If there are no rows, can the column type just be changed?

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message mtakvel 2016-02-05 13:26:45 BUG #13920: pg_try_advisory_xact_lock bigint trouble
Previous Message David G. Johnston 2016-02-05 05:38:34 Re: BUG #13908: Query returns too few rows