summaryrefslogtreecommitdiff
path: root/ext/pgsql/pgsql.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pgsql/pgsql.c')
-rw-r--r--ext/pgsql/pgsql.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index 822dae8de7..bd9a3f6f11 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -5254,30 +5254,18 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z
/* pg_attribute.attlen */
add_assoc_long(elem, "len", atoi(PQgetvalue(pg_result,i,3)));
/* pg_attribute.attnonull */
- !strcmp(PQgetvalue(pg_result,i,4), "t") ?
- add_assoc_bool(elem, "not null", 1) :
- add_assoc_bool(elem, "not null", 0);
+ add_assoc_bool(elem, "not null", !strcmp(PQgetvalue(pg_result,i,4), "t"));
/* pg_attribute.atthasdef */
- !strcmp(PQgetvalue(pg_result,i,5), "t") ?
- add_assoc_bool(elem, "has default", 1) :
- add_assoc_bool(elem, "has default", 0);
+ add_assoc_bool(elem, "has default", !strcmp(PQgetvalue(pg_result,i,5), "t"));
/* pg_attribute.attndims */
add_assoc_long(elem, "array dims", atoi(PQgetvalue(pg_result,i,6)));
/* pg_type.typtype */
- !strcmp(PQgetvalue(pg_result,i,7), "e") ?
- add_assoc_bool(elem, "is enum", 1) :
- add_assoc_bool(elem, "is enum", 0);
+ add_assoc_bool(elem, "is enum", !strcmp(PQgetvalue(pg_result,i,7), "e"));
if (extended) {
/* pg_type.typtype */
- !strcmp(PQgetvalue(pg_result,i,7), "b") ?
- add_assoc_bool(elem, "is base", 1) :
- add_assoc_bool(elem, "is base", 0);
- !strcmp(PQgetvalue(pg_result,i,7), "c") ?
- add_assoc_bool(elem, "is composite", 1) :
- add_assoc_bool(elem, "is composite", 0);
- !strcmp(PQgetvalue(pg_result,i,7), "p") ?
- add_assoc_bool(elem, "is pesudo", 1) :
- add_assoc_bool(elem, "is pesudo", 0);
+ add_assoc_bool(elem, "is base", !strcmp(PQgetvalue(pg_result,i,7), "b"));
+ add_assoc_bool(elem, "is composite", !strcmp(PQgetvalue(pg_result,i,7), "c"));
+ add_assoc_bool(elem, "is pesudo", !strcmp(PQgetvalue(pg_result,i,7), "p"));
/* pg_description.description */
add_assoc_string(elem, "description", PQgetvalue(pg_result,i,8), 1);
}