]> granicus.if.org Git - postgis/commitdiff
Remove the HAS_SCHEMA #define and all related #else code since we now guarantee to...
authorMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Thu, 5 Jun 2008 11:19:29 +0000 (11:19 +0000)
committerMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Thu, 5 Jun 2008 11:19:29 +0000 (11:19 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@2802 b70326c6-7e19-0410-871a-916f4a2858ee

lwgeom/long_xact.sql.in
lwgeom/sqldefines.h.in

index e0b3f7eae0ab24301ccabc518b95027ece0a744f..6972748c38e9248d5f94e8e58ee4c52f1bca1cdd 100644 (file)
@@ -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;
index 8d41a7aa4de92d0a3ccb4b9dcca688711a5dfaa7..ea765e31521d6c0c90998d29274327740cc6bf1b 100644 (file)
@@ -27,6 +27,4 @@
 # define _STRICT STRICT
 # define _SECURITY_DEFINER SECURITY DEFINER
 
-# define HAS_SCHEMAS 1
-
 #endif /* _LWPGIS_DEFINES */