On 7/29/22 04:05, Gianni Ceccarelli wrote:
If you can use bash, or set up some redirections from whatever you're
using to execute ``psql``, you can do::
$ psql somedb --set num=42 <<<'select :num'
Timing is on.
Expanded display is used automatically.
Line style is unicode.
Border
If you can use bash, or set up some redirections from whatever you're
using to execute ``psql``, you can do::
$ psql somedb --set num=42 <<<'select :num'
Timing is on.
Expanded display is used automatically.
Line style is unicode.
Border style is 2.
┌──┐
│ ?column? │
├─
On 7/28/22 12:40, Ron wrote:
$ alias psql12
alias psql12='/usr/lib/postgresql/12/bin/psql -p5433'
This works ask expected:
$ psql12 --set num=42 -ac "\echo :num"
echo :num
42
And so does this:
$ psql12 --set num=42
psql (12.11 (Ubuntu 12.11-1.pgdg18.04+1))
Type "help" for help.
postgres=# s
On 7/28/22 14:47, David G. Johnston wrote:
On Thu, Jul 28, 2022 at 12:40 PM Ron wrote:
What secret sauce am I missing to get this to work?
Given that the documentation says:
"command must be either a command string that is completely parsable by
the server (i.e., it contains no psql-spe
On Thu, Jul 28, 2022 at 12:40 PM Ron wrote:
> What secret sauce am I missing to get this to work?
>
Given that the documentation says:
"command must be either a command string that is completely parsable by the
server (i.e., it contains no psql-specific features), or a single backslash
command.
$ alias psql12
alias psql12='/usr/lib/postgresql/12/bin/psql -p5433'
This works ask expected:
$ psql12 --set num=42 -ac "\echo :num"
echo :num
42
And so does this:
$ psql12 --set num=42
psql (12.11 (Ubuntu 12.11-1.pgdg18.04+1))
Type "help" for help.
postgres=# select :num;
?column?
---