Message posté par : Nicolas Ribot
----------------------------------------
Bonjour,
Un cast devrait suffire:
-----------------
Code :
select '{010010000}'::text[] as asarray,
pg_typeof('{010010000}'::text[]);
-----------------
Si votre colonne est de type text, vous ne pourrez pas faire d'update direct, il
faudra changer le type de text -> text[].
Pour cela, il faut utilser alter table ... alter column ... using, par exemple:
-----------------
Code :
create table test (
msg text
);
insert into test values ('{010010000}');
update test set msg = msg::text[];
select msg, pg_typeof(msg) from test;
-- msg pg_typeof
-- 010010000 text
alter table test alter column msg type text[] using cast(msg as text[]);
select msg, pg_typeof(msg) from test;
--msg pg_typeof
--010010000 text[]
-----------------
Nicolas
----------------------------------------
Le message est situé
https://georezo.net/forum/viewtopic.php?pid=332180#p332180
Pour y répondre : geobd(a)ml.georezo.net ou reply de votre messagerie
Pour vous désabonner connectez-vous sur le forum puis Profil / Abonnement
--
Association GeoRezo - le portail géomatique
https://georezo.net