Re: Postgres 7.3.5 and count('x')

Поиск
Список
Период
Сортировка
От Edwin S. Ramirez
Тема Re: Postgres 7.3.5 and count('x')
Дата
Msg-id 3FD21115.8020703@idconcepts.org
обсуждение исходный текст
Ответ на Re: Postgres 7.3.5 and count('x')  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
I tried :<br /> select count('x') from patients;<br /><br /> And I get the same error.  <br /><br /> select
count('x');should return the same as select count(*); which returns 1.<br /><br /> Previous Postgres versions returned
1.<br/><br /> -ESR-<br /><br /> Peter Eisentraut wrote:<br /><blockquote cite="mid200312061746.37190.peter_e@gmx.net"
type="cite"><prewrap="">Tom Lane wrote: </pre><blockquote type="cite"><pre wrap="">Bruce Momjian <a
class="moz-txt-link-rfc2396E"href="mailto:pgman@candle.pha.pa.us"><pgman@candle.pha.pa.us></a> writes:
</pre><blockquotetype="cite"><pre wrap="">What is COUNT('x') supposed to return?  1?  Is that legal SQL?
</pre></blockquote><prewrap="">Why not?   </pre></blockquote><pre wrap="">
 
Because there is nothing to count.

In general,

SELECT count(expr) FROM table1;

counts the number of rows in table1 where expr evaluates to not null.  
If table1 is not specified, that rule no longer holds.  At best you 
could assume that table1 is empty and return 0.  But a result of 1 I 
cannot see justified.
 </pre></blockquote>

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

Предыдущее
От: NK
Дата:
Сообщение: Help! Parser Stage: Get The Columns Of the Table
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: PostgreSQL port to pure Java?