Re: Query is executing but giving error when using with shell scripting

From: Andreas Kretschmer <andreas(at)a-kretschmer(dot)de>
To: pgsql-sql(at)postgresql(dot)org,srilinux <srilinux09(at)gmail(dot)com>
Subject: Re: Query is executing but giving error when using with shell scripting
Date: 2017-09-14 16:21:59
Message-ID: C759012E-7A15-49A5-A4C3-B9F7D18F6418@a-kretschmer.de
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 14 September 2017 17:58:07 GMT+02:00, srilinux <srilinux09(at)gmail(dot)com> wrote:
>Please suggest what is giving error here
>when I execute from psql prompt, I get the result, when I try to
>automate
>using a shell script, the query is not working
>
># `/usr/bin/psql -U postgres -d coba1 -c "select name from users
>where
>"Date" > current_date - 30;"`
>ERROR: column "Date" does not exist
>LINE 1: select name from users where Date >current_...
>
>
>========
>
Remove the " from Date, or write "date". It is just a quoting-problem.

Regards, Andreas

--
2ndQuadrant - The PostgreSQL Support Company

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message srilinux 2017-09-14 16:27:40 Re: Query is executing but giving error when using with shell scripting
Previous Message srilinux 2017-09-14 15:58:07 Query is executing but giving error when using with shell scripting