Does db_affected_rows() works well with PostgreSQL? This is a clean installation and I was starting to develop a module.
So I have the following code (and nothing more apart from the hook_menu()):

$result = db_query("SELECT * FROM {variable}");
return db_affected_rows();


I used the variable table as an example since it was likely to be populated (and it is, of course!). Well, to my surprise db_affected_rows() always returns 0.
Is there any reason why it doesn't work? Are there any reported bugs that I may have missed?

Setup:


Drupal 6.22
PostgreSQL 8.4
PHP 5.3.8
To summarize for Drupal 6:


db_affected_rows() gives you number of rows returned by a select if the database is MySQL but not if it's PostgreSQL.
In Drupal 6 if you are using PostgreSQL you can run pg_num_rows() on the query to get the number of rows.


It is indeed database specific.

[Reference: this comment in the Drupal documentation]