How to get the OID of a Postgres table?

To get a table OID, cast to the object identifier type regclass (while connected to the same DB!). This finds the first table (or view etc.) with the given (unqualified) name along the search_path or raises an exception if not found: SELECT ‘mytbl’::regclass::oid; Schema-qualify the table name to remove the dependency on the search path: … Read more

Grouping WHERE clauses with Zend_Db_Table_Abstract

In order to achieve this, you have to construct the grouped clause within a single call to the where method. If both values of conditions are the same, you can do this: $select->where(‘client_email = ? OR client_email_alt = ?’, $client_email) If there are multiple placeholders within the string, the DB adapter’s quoteInto method will replace … Read more

tech