This software is distributed under the GNU General Public License
either version 2, or (at your option) any later version.
-query_limit(n)
-
- sets a limit on the maximum numbers of query returned from
- a backend. It can be used to limit the result size retrieved
- by the application for poor input data or to avoid accidental
- table product while playying with sql.
-
backend_pid()
return the pid of our corresponding backend.
min(x,y)
max(x,y)
- return the min or max bteween two integers.
-
-assert_enable(bool)
-
- enable/disable assert checkings in the backend, if it has been
- compiled with USE_ASSERT_CHECKING.
-
-assert_test(bool)
-
- test the assert enable/disable code, if the backend has been
- compiled with ASSERT_CHECKING_TEST.
+ return the min or max of two integers.
--
Massimo Dal Zotto
* either version 2, or (at your option) any later version.
*/
+#include "postgres.h"
+
#include
#include
#include
#include
-#include "postgres.h"
-
#include "access/heapam.h"
#include "access/htup.h"
#include "access/relscan.h"
#include "access/tupdesc.h"
#include "catalog/catname.h"
#include "catalog/pg_listener.h"
+#include "commands/async.h"
#include "fmgr.h"
#include "storage/lmgr.h"
#include "utils/fmgroids.h"
#undef MIN
#define MIN(x,y) ((x)<=(y) ? (x) : (y))
-extern int ExecutorLimit(int limit);
-extern void Async_Unlisten(char *relname, int pid);
-extern int assertTest(int val);
-
-#ifdef ASSERT_CHECKING_TEST
-extern int assertEnable(int val);
-
-#endif
-
-int
-query_limit(int limit)
-{
- return ExecutorLimit(limit);
-}
int
backend_pid()
return count;
}
-#ifdef USE_ASSERT_CHECKING
-int
-assert_enable(int val)
-{
- return assertEnable(val);
-}
-
-#ifdef ASSERT_CHECKING_TEST
-int
-assert_test(int val)
-{
- return assertTest(val);
-}
-
-#endif
-#endif
/* end of file */
#ifndef MISC_UTILS_H
#define MISC_UTILS_H
-int query_limit(int limit);
int backend_pid(void);
int unlisten(char *relname);
int max(int x, int y);
int min(int x, int y);
int active_listeners(text *relname);
-#ifdef USE_ASSERT_CHECKING
-int assert_enable(int val);
-
-#ifdef ASSERT_CHECKING_TEST
-int assert_test(int val);
-
-#endif
#endif
-
-#endif
-
-/*
- * Local Variables:
- * tab-width: 4
- * c-indent-level: 4
- * c-basic-offset: 4
- * End:
- */
-- This file is distributed under the GNU General Public License
-- either version 2, or (at your option) any later version.
--- Set the maximum number of tuples returned by a single query.
---
-create function query_limit(int4) returns int4
- as 'MODULE_PATHNAME'
- language 'C';
-
-- Return the pid of the backend.
--
create function backend_pid() returns int4
as 'MODULE_PATHNAME'
language 'C';
--- Enable/disable Postgres assert checking.
---
-create function assert_enable(int4) returns int4
- as 'MODULE_PATHNAME'
- language 'C';
-
--- Test Postgres assert checking.
---
--- create function assert_test(int4) returns int4
--- as 'MODULE_PATHNAME'
--- language 'C';
-
-- end of file