Skip to content

Instantly share code, notes, and snippets.

View jay-knight's full-sized avatar
🔭
Looking up

Jay Knight jay-knight

🔭
Looking up
View GitHub Profile
@jay-knight
jay-knight / psql_coproc.bash
Created November 12, 2024 22:10
bash postgres coproc
#!/usr/bin/env bash
PSQL_COPROC_RESULT_SEPARATOR="^!^"
pgproc_connect() {
coproc_var=$1; shift;
coproc "$coproc_var" {
psql --quiet --no-align --no-readline --tuples-only --csv "$@";
} 2>/dev/null
}