UPDATE field BIGINT [] from a SELECT

0

I have an update in a field

permissao_ver

Being the same type bigint[] , field response: '{1,2,3,4,5,11,44,56,75,11}'

My Query

UPDATE callcenter.pausa  
SET permissao_ver = '{"(SELECT cod_grupo FROM crm.usuariosgrupos
                        WHERE habilitar = 1)"}'::bigint[] 
WHERE habilitado = 1 AND permissao_ver is null

I need to get the codes that the select will return me from giving an update in this field bigint[] '{XX,XX,XX,X,XX,X}'

    
asked by anonymous 25.01.2017 / 20:11

1 answer

1

Resolved.

UPDATE callcenter.pausa  
SET permissao_ver = array(SELECT cod_grupo 
                          FROM crm.usuariosgrupos
                          WHERE habilitar = 1)
WHERE habilitado = 1 
AND permissao_ver is null
    
26.01.2017 / 12:12