Quoting of SQL excuted via psql via ssh
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I want to execute this SQL line:
select * from "foo" where name='bar'
I call above line "sql_line" in the next statements.
Now I want to call this via psql
:
psql -c sql_line
Now I want to call this via ssh
:
ssh remote-host psql -c sql_line
How to quote this, to get it right?
I tried this, but this fails:
ssh remote-host psql -c "select * from "foo" where name='bar'"
I am using GNU bash, Version 4.3.48
shell quoting
add a comment |Â
up vote
0
down vote
favorite
I want to execute this SQL line:
select * from "foo" where name='bar'
I call above line "sql_line" in the next statements.
Now I want to call this via psql
:
psql -c sql_line
Now I want to call this via ssh
:
ssh remote-host psql -c sql_line
How to quote this, to get it right?
I tried this, but this fails:
ssh remote-host psql -c "select * from "foo" where name='bar'"
I am using GNU bash, Version 4.3.48
shell quoting
Why do we need to do withssh
in particular? cant we configure remote acces in psql?
â msp9011
Sep 5 at 11:41
@SivaPrasath this does not work. The bash thinks the statement is not finished yet. It displays>
after I am hitting enter.
â guettli
Sep 5 at 12:13
@SivaPrasath ssh is needed. A firewall is blocking direct connections to the DB.
â guettli
Sep 5 at 14:33
check : stackoverflow.com/questions/48127483/â¦
â msp9011
Sep 5 at 14:39
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I want to execute this SQL line:
select * from "foo" where name='bar'
I call above line "sql_line" in the next statements.
Now I want to call this via psql
:
psql -c sql_line
Now I want to call this via ssh
:
ssh remote-host psql -c sql_line
How to quote this, to get it right?
I tried this, but this fails:
ssh remote-host psql -c "select * from "foo" where name='bar'"
I am using GNU bash, Version 4.3.48
shell quoting
I want to execute this SQL line:
select * from "foo" where name='bar'
I call above line "sql_line" in the next statements.
Now I want to call this via psql
:
psql -c sql_line
Now I want to call this via ssh
:
ssh remote-host psql -c sql_line
How to quote this, to get it right?
I tried this, but this fails:
ssh remote-host psql -c "select * from "foo" where name='bar'"
I am using GNU bash, Version 4.3.48
shell quoting
shell quoting
asked Sep 5 at 11:27
guettli
118520
118520
Why do we need to do withssh
in particular? cant we configure remote acces in psql?
â msp9011
Sep 5 at 11:41
@SivaPrasath this does not work. The bash thinks the statement is not finished yet. It displays>
after I am hitting enter.
â guettli
Sep 5 at 12:13
@SivaPrasath ssh is needed. A firewall is blocking direct connections to the DB.
â guettli
Sep 5 at 14:33
check : stackoverflow.com/questions/48127483/â¦
â msp9011
Sep 5 at 14:39
add a comment |Â
Why do we need to do withssh
in particular? cant we configure remote acces in psql?
â msp9011
Sep 5 at 11:41
@SivaPrasath this does not work. The bash thinks the statement is not finished yet. It displays>
after I am hitting enter.
â guettli
Sep 5 at 12:13
@SivaPrasath ssh is needed. A firewall is blocking direct connections to the DB.
â guettli
Sep 5 at 14:33
check : stackoverflow.com/questions/48127483/â¦
â msp9011
Sep 5 at 14:39
Why do we need to do with
ssh
in particular? cant we configure remote acces in psql?â msp9011
Sep 5 at 11:41
Why do we need to do with
ssh
in particular? cant we configure remote acces in psql?â msp9011
Sep 5 at 11:41
@SivaPrasath this does not work. The bash thinks the statement is not finished yet. It displays
>
after I am hitting enter.â guettli
Sep 5 at 12:13
@SivaPrasath this does not work. The bash thinks the statement is not finished yet. It displays
>
after I am hitting enter.â guettli
Sep 5 at 12:13
@SivaPrasath ssh is needed. A firewall is blocking direct connections to the DB.
â guettli
Sep 5 at 14:33
@SivaPrasath ssh is needed. A firewall is blocking direct connections to the DB.
â guettli
Sep 5 at 14:33
check : stackoverflow.com/questions/48127483/â¦
â msp9011
Sep 5 at 14:39
check : stackoverflow.com/questions/48127483/â¦
â msp9011
Sep 5 at 14:39
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f466991%2fquoting-of-sql-excuted-via-psql-via-ssh%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Why do we need to do with
ssh
in particular? cant we configure remote acces in psql?â msp9011
Sep 5 at 11:41
@SivaPrasath this does not work. The bash thinks the statement is not finished yet. It displays
>
after I am hitting enter.â guettli
Sep 5 at 12:13
@SivaPrasath ssh is needed. A firewall is blocking direct connections to the DB.
â guettli
Sep 5 at 14:33
check : stackoverflow.com/questions/48127483/â¦
â msp9011
Sep 5 at 14:39