[SQL] Query is executing but giving error when using with shell scripting

Поиск
Список
Период
Сортировка
От srilinux
Тема [SQL] Query is executing but giving error when using with shell scripting
Дата
Msg-id 1505404687156-0.post@n3.nabble.com
обсуждение исходный текст
Ответы Re: [SQL] Query is executing but giving error when using with shell scripting  (Andreas Kretschmer <andreas@a-kretschmer.de>)
Список pgsql-sql
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_...


========

works below
                                         ^sudo -u postgres psql

psql (9.4.5)
Type "help" for help.

postgres=# \connect coba1
You are now connected to database "coba1" as user "postgres".
coba1=# select name from users where "Date" >current_date - 30;       name
---------------------coba11testCoba11





--
Sent from: http://www.postgresql-archive.org/PostgreSQL-sql-f2142323.html


-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

В списке pgsql-sql по дате отправления:

Предыдущее
От: Andreas Kretschmer
Дата:
Сообщение: Re: [SQL] How could I improve a query with a function in the join clause?
Следующее
От: Andreas Kretschmer
Дата:
Сообщение: Re: [SQL] Query is executing but giving error when using with shell scripting