On 15 March 2016 at 13:15, drum.lu...@gmail.com <drum.lu...@gmail.com>
wrote:

> Eu poderia fazer algo do tipo...
>
> INSERT INTO targettable (col1, col2, col3)
>> SELECT col1, col2 || '_' || nextval('sequence_name')::text, col3
>> FROM stagingtable;
>
>
> ?
>


INSERT INTO junk.wm2 (account_id, code, info)
SELECT account_id, uuid_generate_v4(), info
FROM junk.wm1;

abc77f31-0ee6-44fd-b954-08a3a3aa7b28
f307fb42-23e5-4742-ab8f-8ce5c0a8e852


Funciona perfeitamente. Porém, ele gera um código grande e sem texto na
frente.
Tem como eu ter dados do tipo?

test_32152563bdc4db11aa
test_321525694417ad6b5f
_______________________________________________
pgbr-geral mailing list
pgbr-geral@listas.postgresql.org.br
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a