diff options
author | Dries Buytaert <dries@buytaert.net> | 2007-04-21 18:08:41 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2007-04-21 18:08:41 +0000 |
commit | 9050e15621523ed306fda50d24f5fe79eaa3ddb0 (patch) | |
tree | b06513cfc48c5a2085f62f42e6199bf162f27df1 /includes/database.pgsql.inc | |
parent | cf050e5f6e79841f79a29763ba757850d441e281 (diff) | |
download | brdo-9050e15621523ed306fda50d24f5fe79eaa3ddb0.tar.gz brdo-9050e15621523ed306fda50d24f5fe79eaa3ddb0.tar.bz2 |
- Patch #137479 by dww: added db_column_exits(). (Yay, the servers are snappy on Saturday evening.)
Diffstat (limited to 'includes/database.pgsql.inc')
-rw-r--r-- | includes/database.pgsql.inc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/includes/database.pgsql.inc b/includes/database.pgsql.inc index 56a30ee9a..be5e4447a 100644 --- a/includes/database.pgsql.inc +++ b/includes/database.pgsql.inc @@ -395,6 +395,13 @@ function db_table_exists($table) { } /** + * Check if a column exists in the given table. + */ +function db_column_exists($table, $column) { + return db_result(db_query("SELECT COUNT(pg_attribute.attname) FROM pg_class, pg_attribute WHERE pg_attribute.attrelid = pg_class.oid AND pg_class.relname = '{". db_escape_table($table) ."}' AND attname='%s'", $column)); +} + +/** * Verify if the database is set up correctly. */ function db_check_setup() { |