use of IN() with literals

Поиск
Список
Период
Сортировка
От Dennis Gearon
Тема use of IN() with literals
Дата
Msg-id 997364.42783.qm@web82105.mail.mud.yahoo.com
обсуждение исходный текст
Ответы Re: use of IN() with literals  (Thomas Kellerer <spam_eater@gmx.net>)
Re: use of IN() with literals  (David W Noon <dwnoon@ntlworld.com>)
Список pgsql-general
I'm trying to use the following script: (to give command line ability to change grant on all tables in public in a
database)

psql -t -c “SELECT ‘GRANT $1 ON public.’ || t.relname || ‘ TO $2;’ from pg_class t, pg_namespace s WHERE t.relkind IN
(‘r’,‘v’, ‘S’) AND t.relnamespace=s.oid AND s.nspname=’public’;” $3 | psql $3 

and it always fails at the "IN(‘r’, ‘v’, ‘S’)" part. psql won't accept the literals in the IN clause. Is this normal?
Whatcould fix this? 

I've tried just doing:
(
after logging in to psql connected to a specific database)

select * from pg_class where relkind IN IN (‘r’, ‘v’, ‘S’);

and that doesn't work either.

Dennis Gearon

Signature Warning
----------------
EARTH has a Right To Life,
  otherwise we all die.

Read 'Hot, Flat, and Crowded'
Laugh at http://www.yert.com/film.php

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

Предыдущее
От: Scott Mead
Дата:
Сообщение: Re: pg_restore to log file
Следующее
От: Thomas Kellerer
Дата:
Сообщение: Re: use of IN() with literals