This is a split version of previous patch: http://drupal.org/node/178555. This patch only consider about the tidy up of database.pgsql.inc, plus minor update to db_table_exists() and db_column_exists(), which synchronize with mysql version. No change to db_query_range() and db_query_temporary() as that will consider as another issue. Should be trivial to commit.

Comments

hswong3i’s picture

Patch tested for PostgreSQL 8.1.9 on Debian etch 4.0r1 with PHP 5.2.0-8+etch7. Both core and modules installation are passed with no error message. Should be trivial to commit.

hswong3i’s picture

Title: Tidy up database.pgsql.inc » Coding standard: database.pgsql.inc
StatusFileSize
new4.41 KB

Patch reroll via latest CVS HEAD. It is simple enough, with no critical logic change, and ready for commit. May someone give me a hand?

hswong3i’s picture

Title: Coding standard: database.pgsql.inc » code cleanup: database.pgsql.inc
Priority: Normal » Minor
StatusFileSize
new4.41 KB

Patch reroll via latest CVS HEAD. Already merge with #172541 for D7 preparation, so shouldn't be too hurry right now.

klando’s picture

I'd like to prevent you to use COUNT for test if a row exist or not. In fact , it will be an extra cost in postgresl, you can just "select 1 from ....." wich is better.

hswong3i’s picture

StatusFileSize
new4.37 KB

@klando: thank you for your suggestion :)

Patch reroll via CVS HEAD, with "SELECT 1" instead of "SELECT COUNT(...)".

I test this patch with a flesh new CVS HEAD PgSQL install, active PHP filter, and create a node with PHP filter which call db_table_exists() and db_column_exists() directly. The result is positive: they are working correctly as expected :)

hswong3i’s picture

Status: Needs review » Closed (won't fix)

Nothing will happened even without this cleanup. Don't waste time in here.

hswong3i’s picture

Priority: Minor » Normal
Status: Closed (won't fix) » Needs review
StatusFileSize
new10.61 KB
  1. Update PHP module checking with more explicitly handling (clone from mysqli).
  2. <code> is not allow for _db_error_page().
  3. Sync debug handling as case of MySQL, within _db_query().
  4. Simplify db_query_range() and db_query_temporary(), remove duplicate code.
  5. Change $new_keys as $keys_new (Sync with MySQL).
  6. Some other minor coding style cleanup.
hswong3i’s picture

Status: Needs review » Closed (won't fix)

Let's move focus to D7.