Skip to content

Instantly share code, notes, and snippets.

select substring(nome from '\d+'), nome, * from arquivo_morto am where pasta = 'titulos' and substring(nome from '[a-zA-Z\s]+') is null
update arquivo_morto set nome = replace(replace(nome, 'TIT', ''), '.pdf', '') where pasta = 'titulos' and substring(nome from '[a-zA-Z\s]+') is null;
update arquivo_morto set nome = substring(nome from '\d+')::numeric::text where pasta = 'titulos' and substring(nome from '[a-zA-Z\s]+') is null;
-- Títulos:
with arquivos as (
select
p.id referencia
@jonathanalves
jonathanalves / list-constraints-analyze-query.sql
Last active April 5, 2022 23:47 — forked from PickledDragon/list-constraints.sql
Postgres list all constraints
-- http://tatiyants.com/pev/
EXPLAIN (COSTS OFF)
EXPLAIN (ANALYZE, COSTS, VERBOSE, BUFFERS, FORMAT JSON)
-- realizar a analise da query lenta
explain (analyze,buffers,timing) DELETE FROM indicador_pessoal_versao where id = 'c5df0553-612c-4a89-9d48-131890efff92'
-- https://www.cybertec-postgresql.com/en/avoid-or-for-better-performance/