Camilo, obrigado!

Eu não consigo mudar a query para ser CTE, por exemplo. No meu caso, posso incluir a string_to_array num "CASE WHEN'? Para substituir o 'WHERE'?

Se sim, poderia ajudar com a syntax ?

Obrigado! Patrick


Utilizando o with o código ficaria mais legível e também você só converteria as string para array uma vez. Mas você pode realizar a conversão diretamente no where, não sei se ficaria muito performático. Algo como:

where (string_to_array(path, '/'))[8] = 'main'

Ou utilizando a função split_part [1]:

where split_part(path, '/', 8) = 'main'

[1] https://www.postgresql.org/docs/9.1/static/functions-string.html#FUNCTIONS-STRING-OTHER

Att: Camilo Santos.
_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a