Re: ERROR: column "time" cannot be cast to type bigint

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Saurabh Agrawal, 20.04.2011 08:38:
Hi All,

I am trying to alter column from "timestamp without timezone" to
"bigint" but getting below error:

#ALTER TABLE test ALTER column time type bigint;
#ERROR:  column "time" cannot be cast to type bigint

Is there any other method for alter column to bigint.


This should do it:

ALTER TABLE test ALTER column time type bigint USING extract(epoch from time)

(Btw: I would avoid column names that are keywords like "time")

Thomas



--
Sent via pgsql-admin mailing list (pgsql-admin@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux