From: Mark Cave-Ayland Date: Thu, 5 Jun 2008 11:19:29 +0000 (+0000) Subject: Remove the HAS_SCHEMA #define and all related #else code since we now guarantee to... X-Git-Tag: 1.4.0b1~890 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a54e08c0512f8153bd7c0a0dba69d3c9a16c2f4c;p=postgis Remove the HAS_SCHEMA #define and all related #else code since we now guarantee to be using PostgreSQL > 7.2 git-svn-id: http://svn.osgeo.org/postgis/trunk@2802 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/lwgeom/long_xact.sql.in b/lwgeom/long_xact.sql.in index e0b3f7eae..6972748c3 100644 --- a/lwgeom/long_xact.sql.in +++ b/lwgeom/long_xact.sql.in @@ -66,15 +66,10 @@ BEGIN EXECUTE ''DELETE FROM authorization_table WHERE expires < now()''; -#ifdef HAS_SCHEMAS SELECT c.oid INTO mytoid FROM pg_class c, pg_namespace n WHERE c.relname = mytable AND c.relnamespace = n.oid AND n.nspname = myschema; -#else - SELECT c.oid INTO mytoid FROM pg_class c - WHERE c.relname = mytable; -#endif -- RAISE NOTICE ''toid: %'', mytoid; @@ -110,22 +105,14 @@ CREATEFUNCTION LockRow(text, text, text, text) CREATEFUNCTION LockRow(text, text, text) RETURNS int AS -#ifdef HAS_SCHEMAS 'SELECT LockRow(current_schema(), $1, $2, $3, now()::timestamp+''1:00'');' -#else -'SELECT LockRow('''', $1, $2, $3, now()::timestamp+''1:00'');' -#endif LANGUAGE 'sql' _VOLATILE_STRICT; -- LockRow(schema, table, rid, expires); CREATEFUNCTION LockRow(text, text, text, timestamp) RETURNS int AS -#ifdef HAS_SCHEMAS 'SELECT LockRow(current_schema(), $1, $2, $3, $4);' -#else -'SELECT LockRow('''', $1, $2, $3, $4);' -#endif LANGUAGE 'sql' _VOLATILE_STRICT; @@ -170,30 +157,22 @@ CREATEFUNCTION CheckAuth(text, text, text) RETURNS INT AS ' DECLARE -#ifdef HAS_SCHEMAS schema text; -#endif BEGIN IF NOT LongTransactionsEnabled() THEN RAISE EXCEPTION ''Long transaction support disabled, use EnableLongTransaction() to enable.''; END IF; -#ifdef HAS_SCHEMAS if ( $1 != '''' ) THEN schema = $1; ELSE SELECT current_schema() into schema; END IF; -#endif -- TODO: check for an already existing trigger ? EXECUTE ''CREATE TRIGGER check_auth BEFORE UPDATE OR DELETE ON '' -#ifdef HAS_SCHEMAS || quote_ident(schema) || ''.'' || quote_ident($2) -#else - || quote_ident($2) -#endif ||'' FOR EACH ROW EXECUTE PROCEDURE CheckAuthTrigger('' || quote_literal($3) || '')''; @@ -261,20 +240,14 @@ BEGIN IF NOT exists THEN "query" = ''CREATE VIEW authorized_tables AS '' || ''SELECT '' || -#ifdef HAS_SCHEMAS ''n.nspname as schema, '' || -#endif ''c.relname as table, trim('' || quote_literal(chr(92) || ''000'') || '' from t.tgargs) as id_column '' || ''FROM pg_trigger t, pg_class c, pg_proc p '' || -#ifdef HAS_SCHEMAS '', pg_namespace n '' || -#endif ''WHERE p.proname = '' || quote_literal(''checkauthtrigger'') || -#ifdef HAS_SCHEMAS '' AND c.relnamespace = n.oid'' || -#endif '' AND t.tgfoid = p.oid and t.tgrelid = c.oid''; EXECUTE "query"; END IF; diff --git a/lwgeom/sqldefines.h.in b/lwgeom/sqldefines.h.in index 8d41a7aa4..ea765e315 100644 --- a/lwgeom/sqldefines.h.in +++ b/lwgeom/sqldefines.h.in @@ -27,6 +27,4 @@ # define _STRICT STRICT # define _SECURITY_DEFINER SECURITY DEFINER -# define HAS_SCHEMAS 1 - #endif /* _LWPGIS_DEFINES */