Sample Header Ad - 728x90

psql subshell \! command - how to get the effect of variable interpolation or backquote expansion

3 votes
2 answers
53 views
The psql manual for the subshell command "\\!" says > Unlike most other meta-commands, the entire remainder of the line is > always taken to be the argument(s) of \\!, and neither variable > interpolation nor backquote expansion are performed in the arguments. > The rest of the line is simply passed literally to the shell. So it seems like it's impossible to substitute any parameters at all - the command string must be a literal. I really need to include the port number as one of the arguments to my shell command. Has anyone found a trick to get around this limitation?
Asked by sevzas (373 rep)
Jun 16, 2025, 06:33 PM
Last activity: Jun 19, 2025, 07:17 PM