diff options
author | lawrance <lawrance@FreeBSD.org> | 2005-08-04 15:25:37 +0800 |
---|---|---|
committer | lawrance <lawrance@FreeBSD.org> | 2005-08-04 15:25:37 +0800 |
commit | d622c6db33aac3aa69c47da37dafd412fecad66f (patch) | |
tree | 3868231e104c9bb7271d0b1eba025c46b6d7c908 | |
parent | 7f001edeeb71551558f300d377b8f481fed17e52 (diff) | |
download | freebsd-ports-gnome-d622c6db33aac3aa69c47da37dafd412fecad66f.tar.gz freebsd-ports-gnome-d622c6db33aac3aa69c47da37dafd412fecad66f.tar.zst freebsd-ports-gnome-d622c6db33aac3aa69c47da37dafd412fecad66f.zip |
Fix build when WITH_PGSQL is set.
PR: ports/84522
Submitted by: Dominik Brettnacher <domi@saargate.de> (maintainer)
Approved by: portmgr (clement)
-rw-r--r-- | databases/gtksql/files/patch-postgres.c | 48 |
1 files changed, 46 insertions, 2 deletions
diff --git a/databases/gtksql/files/patch-postgres.c b/databases/gtksql/files/patch-postgres.c index 4e291b4cb0b7..51adb3745ef2 100644 --- a/databases/gtksql/files/patch-postgres.c +++ b/databases/gtksql/files/patch-postgres.c @@ -1,5 +1,5 @@ ---- postgres.c.orig Sat Apr 21 19:16:37 2001 -+++ postgres.c Sat Apr 21 19:16:47 2001 +--- postgres.c.orig Sat Jun 5 15:05:36 1999 ++++ postgres.c Wed Aug 3 17:22:55 2005 @@ -18,7 +18,7 @@ #include <libpq-fe.h> @@ -9,3 +9,47 @@ #include "common.h" #include "status.h" +@@ -129,14 +129,7 @@ + PGresult *table_info; + char query[512]; + +- sprintf(query, "SELECT a.attnum, a.attname, t.typname, a.attlen, +- a.atttypmod, a.attnotnull, a.atthasdef +- FROM pg_class c, pg_attribute a, pg_type t +- WHERE c.relname = '%s' AND +- a.attnum > 0 AND +- a.attrelid = c.oid AND +- a.atttypid = t.oid +- ORDER BY attnum", tbf->name); ++ sprintf(query, "SELECT a.attnum, a.attname, t.typname, a.attlen, a.atttypmod, a.attnotnull, a.atthasdef FROM pg_class c, pg_attribute a, pg_type t WHERE c.relname = '%s' AND a.attnum > 0 AND a.attrelid = c.oid AND a.atttypid = t.oid ORDER BY attnum", tbf->name); + + table_info = PQexec(conn, query); + if ((table_info == NULL) || +@@ -183,11 +176,7 @@ + if (rnotnull[0] == 't') + strcat(type_str, " not null"); + if (rhasdef[0] == 't') { +- sprintf(buf, "SELECT d.adsrc +- FROM pg_attrdef d, pg_class c +- WHERE c.relname = '%s' AND +- c.oid = d.adrelid AND +- d.adnum = %s", ++ sprintf(buf, "SELECT d.adsrc FROM pg_attrdef d, pg_class c WHERE c.relname = '%s' AND c.oid = d.adrelid AND d.adnum = %s", + tbf->name, PQgetvalue(table_info, i, 0)); + table_info2 = PQexec(conn, buf); + if ((table_info2 == NULL) || +@@ -240,13 +229,7 @@ + PGresult *tables; + char query[512]; + +- sprintf(query, "SELECT usename, relname, relkind, relhasrules +- FROM pg_class, pg_user +- WHERE relkind = 'r' AND +- relname !~ '^pg_' AND +- relname !~ '^xin[vx][0-9]+' AND +- usesysid = relowner +- ORDER BY relname"); ++ sprintf(query, "SELECT usename, relname, relkind, relhasrules FROM pg_class, pg_user WHERE relkind = 'r' AND relname !~ '^pg_' AND relname !~ '^xin[vx][0-9]+' AND usesysid = relowner ORDER BY relname"); + + tables = PQexec(conn->conn, query); + if ((tables == NULL) || (PQresultStatus(tables) != PGRES_TUPLES_OK)) { |