Unix Technical Forum

Re: question about count(b) where b is a custom type

This is a discussion on Re: question about count(b) where b is a custom type within the pgsql Hackers forums, part of the PostgreSQL category; --> > Firstly, if you just want a count, what's wrong with count(1) or > count(*). > Because unless the ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Hackers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-11-2008, 07:49 AM
Pollard, Mike
 
Posts: n/a
Default Re: question about count(b) where b is a custom type

> Firstly, if you just want a count, what's wrong with count(1) or
> count(*).
>


Because unless the column does not allow nulls, they will not return the
same value.

Mike Pollard
SUPRA Server SQL Engineering and Support
Cincom Systems, Inc.
--------------------------------
Better to remain silent and be thought a fool than to speak out and
remove all doubt.
Abraham Lincoln



---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-11-2008, 07:49 AM
Richard Huxton
 
Posts: n/a
Default Re: question about count(b) where b is a custom type

Pollard, Mike wrote:
>>Firstly, if you just want a count, what's wrong with count(1) or
>>count(*).
>>

>
>
> Because unless the column does not allow nulls, they will not return the
> same value.


Ah, but in the example given the column was being matched against a
value, so nulls were already excluded.

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:05 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com