Question on confusing behavior

Поиск
Список
Период
Сортировка
От Steve Wolfe
Тема Question on confusing behavior
Дата
Msg-id 37EA79F4.273CFE3F@iboats.com
обсуждение исходный текст
Ответы Re: [GENERAL] Question on confusing behavior  (Bruce Momjian <maillist@candle.pha.pa.us>)
Список pgsql-general
   Today, I told someone the syntax for "count" without thinking, and
got it wrong - and in so doing, I found some interesting behavior.


select count('table.fieldname');

works.  however...

select count('table.fieldname') where table.fieldname='something';

not only barfs, it kills your connection to the back-end.  Then...

select count(table.fieldname) where table.fieldname='something';


works fine.

  So, if the field name to count is enclosed in ticks, it works if there
is no where clause, but not if there is a where clause.

  Now I'm not an expert at SQL, so I realize that it could be because I
used totally illegal syntax.  But, then I'd think that postgres would
barf consistantly.  Anyone care to enlighten me as to what's going on?

steve

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

Предыдущее
От: Michael Simms
Дата:
Сообщение: User Gallery in a mess
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [GENERAL] Question on confusing behavior