7.4 quoting

Lists: pgsql-general
From: Steve Clark <sclark(at)netwolves(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: 7.4 quoting
Date: 2011-03-31 16:56:45
Message-ID: 4D94B24D.2020509@netwolves.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Hi List,

I am having a problem trying to do the following:
ssh postgres(at)192(dot)168(dot)198(dot)93 'psql -Atc "select a.interface, a.source_ip,a.dest_ip from kernel_gre a, ospfd_interface b where a.interface = b.interface and config ilike '%cost 50%';" config.db'

bash turns it into this:
ssh postgres(at)192(dot)168(dot)198(dot)93 'psql -Atc "select a.interface, a.source_ip,a.dest_ip from kernel_gre a, ospfd_interface b where a.interface = b.interface and config ilike %cost' '50%;" config.db'

I tried various things using \' or '' or ''' but none work.
I have even tried exchanging the outer " with ' and the inner "select to 'select but still no success.

Any ideas?

With 8.x databases I use \$\$%cost 50%\$\$ which work great.
--
Stephen Clark
*NetWolves*
Sr. Software Engineer III
Phone: 813-579-3200
Fax: 813-882-0209
Email: steve(dot)clark(at)netwolves(dot)com
http://www.netwolves.com


From: Arjen Nienhuis <a(dot)g(dot)nienhuis(at)gmail(dot)com>
To: Steve Clark <sclark(at)netwolves(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: 7.4 quoting
Date: 2011-03-31 18:05:19
Message-ID: AANLkTikycLLkQWhf0UykiJRPrkULc9PFi0EcWQp=xX9B@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Thu, Mar 31, 2011 at 18:56, Steve Clark <sclark(at)netwolves(dot)com> wrote:
> Hi List,
>
> I am having a problem trying to do the following:
> ssh postgres(at)192(dot)168(dot)198(dot)93 'psql -Atc "select a.interface,
> a.source_ip,a.dest_ip from kernel_gre a, ospfd_interface b where a.interface
> = b.interface and config ilike '%cost 50%';" config.db'
>
> bash turns it into this:
> ssh postgres(at)192(dot)168(dot)198(dot)93 'psql -Atc "select a.interface,
> a.source_ip,a.dest_ip from kernel_gre a, ospfd_interface b where a.interface
> = b.interface and config ilike %cost' '50%;" config.db'
try:

ssh postgres(at)192(dot)168(dot)198(dot)93 'psql -Atc "select a.interface,
a.source_ip,a.dest_ip from kernel_gre a, ospfd_interface b where
a.interface = b.interface and config ilike '%cost 50%';" config.db'

which bash turns into:

ssh postgres(at)192(dot)168(dot)198(dot)93 psql -Atc "select a.interface,
a.source_ip,a.dest_ip from kernel_gre a, ospfd_interface b where
a.interface = b.interface and config ilike '%cost 50%'" config.db


From: Arjen Nienhuis <a(dot)g(dot)nienhuis(at)gmail(dot)com>
To: Steve Clark <sclark(at)netwolves(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: 7.4 quoting
Date: 2011-03-31 18:06:48
Message-ID: AANLkTikK7e-U8oXKLEmCTC0H9V9W4i3neR+5Nb6y25XR@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Thu, Mar 31, 2011 at 20:05, Arjen Nienhuis <a(dot)g(dot)nienhuis(at)gmail(dot)com> wrote:
> On Thu, Mar 31, 2011 at 18:56, Steve Clark <sclark(at)netwolves(dot)com> wrote:
>> Hi List,
>>
>> I am having a problem trying to do the following:
>> ssh postgres(at)192(dot)168(dot)198(dot)93 'psql -Atc "select a.interface,
>> a.source_ip,a.dest_ip from kernel_gre a, ospfd_interface b where a.interface
>> = b.interface and config ilike '%cost 50%';" config.db'
>>
>> bash turns it into this:
>> ssh postgres(at)192(dot)168(dot)198(dot)93 'psql -Atc "select a.interface,
>> a.source_ip,a.dest_ip from kernel_gre a, ospfd_interface b where a.interface
>> = b.interface and config ilike %cost' '50%;" config.db'
> try:
>
> ssh postgres(at)192(dot)168(dot)198(dot)93 'psql -Atc "select a.interface,
> a.source_ip,a.dest_ip from kernel_gre a, ospfd_interface b where
> a.interface = b.interface and config ilike '%cost 50%';" config.db'
>
> which bash turns into:
>
> ssh postgres(at)192(dot)168(dot)198(dot)93 psql -Atc "select a.interface,
> a.source_ip,a.dest_ip from kernel_gre a, ospfd_interface b where
> a.interface = b.interface and config ilike '%cost 50%'" config.db
>

Argh!

I mean:

ssh postgres(at)192(dot)168(dot)198(dot)93 psql -Atc \"select a.interface,
a.source_ip,a.dest_ip from kernel_gre a, ospfd_interface b where
a.interface = b.interface and config ilike \'%cost 50%\'\" config.db


From: Steve Clark <sclark(at)netwolves(dot)com>
To: Arjen Nienhuis <a(dot)g(dot)nienhuis(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: 7.4 quoting
Date: 2011-03-31 19:07:51
Message-ID: 4D94D107.8030809@netwolves.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On 03/31/2011 02:06 PM, Arjen Nienhuis wrote:
> On Thu, Mar 31, 2011 at 20:05, Arjen Nienhuis<a(dot)g(dot)nienhuis(at)gmail(dot)com> wrote:
>> On Thu, Mar 31, 2011 at 18:56, Steve Clark<sclark(at)netwolves(dot)com> wrote:
>>> Hi List,
>>>
>>> I am having a problem trying to do the following:
>>> ssh postgres(at)192(dot)168(dot)198(dot)93 'psql -Atc "select a.interface,
>>> a.source_ip,a.dest_ip from kernel_gre a, ospfd_interface b where a.interface
>>> = b.interface and config ilike '%cost 50%';" config.db'
>>>
>>> bash turns it into this:
>>> ssh postgres(at)192(dot)168(dot)198(dot)93 'psql -Atc "select a.interface,
>>> a.source_ip,a.dest_ip from kernel_gre a, ospfd_interface b where a.interface
>>> = b.interface and config ilike %cost' '50%;" config.db'
>> try:
>>
>> ssh postgres(at)192(dot)168(dot)198(dot)93 'psql -Atc "select a.interface,
>> a.source_ip,a.dest_ip from kernel_gre a, ospfd_interface b where
>> a.interface = b.interface and config ilike '%cost 50%';" config.db'
>>
>> which bash turns into:
>>
>> ssh postgres(at)192(dot)168(dot)198(dot)93 psql -Atc "select a.interface,
>> a.source_ip,a.dest_ip from kernel_gre a, ospfd_interface b where
>> a.interface = b.interface and config ilike '%cost 50%'" config.db
>>
> Argh!
>
> I mean:
>
> ssh postgres(at)192(dot)168(dot)198(dot)93 psql -Atc \"select a.interface,
> a.source_ip,a.dest_ip from kernel_gre a, ospfd_interface b where
> a.interface = b.interface and config ilike \'%cost 50%\'\" config.db
>
Great! that did it thanks a bunch!!!

Regards,
Steve

--
Stephen Clark
*NetWolves*
Sr. Software Engineer III
Phone: 813-579-3200
Fax: 813-882-0209
Email: steve(dot)clark(at)netwolves(dot)com
http://www.netwolves.com