Hans Kristian Rosbach wrote:
create index idx_test on dbmail_messages (mailbox_idnr, status,
count(message_idnr));
This won't work, of course.
sh-3.00$ psql dbmail
Welcome to psql 7.4.6, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit
dbmail=# create index idx_test on dbmail_messages (mailbox_idnr, status,
dbmail(# count(message_idnr));
ERROR: cannot use aggregate function in index expression
A recent discussion shows fixing this is on the TODO list for postgresql.
--
________________________________________________________________
Paul Stevens [EMAIL PROTECTED]
NET FACILITIES GROUP GPG/PGP: 1024D/11F8CD31
The Netherlands_______________________________________www.nfg.nl