am Mon, dem 10.11.2008, um 15:34:10 +0100 mailte Mario Splivalo folgendes:
> I have a table, like this:
>
> CREATE TABLE t1
> (
> u1 character varying
> )
>
> And some data inside:
>
> INSERT INTO t1 (u1) VALUES ('62d6b434-7dfd-4b3b-b1bf-87f6c20c10dd');
> INSERT INTO t1 (u1) VALUES ('e3fee596-164b-4995-9e0d-7b2a79e83752');
>
> Now, I can do this:
>
> SELECT u1::uuid FROM t1;
>
> But I can't do this:
>
> ALTER TABLE t1 ALTER u1 TYPE uuid;
test=# CREATE TABLE t1
test-# (
test(# u1 character varying
test(# )
test-# ;
CREATE TABLE
test=# INSERT INTO t1 (u1) VALUES
('62d6b434-7dfd-4b3b-b1bf-87f6c20c10dd');
INSERT 0 1
test=# alter table t1 alter column u1 type uuid using u1::uuid;
ALTER TABLE
test=# \d t1; Table "public.t1"Column | Type | Modifiers
--------+------+-----------u1 | uuid |
Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net