* Copyright (c) 2002, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/lockfuncs.c,v 1.1 2002/08/17 13:11:43 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/lockfuncs.c,v 1.2 2002/08/27 04:00:28 momjian Exp $
*/
#include "postgres.h"
#include "fmgr.h"
#include "funcapi.h"
+#include "catalog/pg_type.h"
#include "storage/lmgr.h"
#include "storage/lock.h"
#include "storage/lwlock.h"
#include "storage/proc.h"
-Datum lock_status_srf(PG_FUNCTION_ARGS);
+Datum pg_lock_status(PG_FUNCTION_ARGS);
static int next_lock(int locks[]);
Datum
-lock_status_srf(PG_FUNCTION_ARGS)
+pg_lock_status(PG_FUNCTION_ARGS)
{
FuncCallContext *funccxt;
LockData *lockData;
TupleDesc tupdesc;
funccxt = SRF_FIRSTCALL_INIT();
- tupdesc = RelationNameGetTupleDesc("pg_catalog.pg_locks_result");
+ tupdesc = CreateTemplateTupleDesc(5, WITHOUTOID);
+ TupleDescInitEntry(tupdesc, (AttrNumber) 1, "relation",
+ OIDOID, -1, 0, false);
+ TupleDescInitEntry(tupdesc, (AttrNumber) 2, "database",
+ OIDOID, -1, 0, false);
+ TupleDescInitEntry(tupdesc, (AttrNumber) 3, "backendpid",
+ INT4OID, -1, 0, false);
+ TupleDescInitEntry(tupdesc, (AttrNumber) 4, "mode",
+ TEXTOID, -1, 0, false);
+ TupleDescInitEntry(tupdesc, (AttrNumber) 5, "isgranted",
+ BOOLOID, -1, 0, false);
+
funccxt->slot = TupleDescGetSlot(tupdesc);
funccxt->attinmeta = TupleDescGetAttInMetadata(tupdesc);
# Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California
#
-# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.168 2002/08/17 15:12:07 momjian Exp $
+# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.169 2002/08/27 04:00:28 momjian Exp $
#
#-------------------------------------------------------------------------
pg_stat_get_db_blocks_hit(D.oid) AS blks_hit \
FROM pg_database D;
-CREATE VIEW pg_locks_result AS \
+CREATE VIEW pg_locks AS \
SELECT \
- ''::oid AS relation, \
- ''::oid AS database, \
- ''::int4 AS backendpid, \
- ''::text AS mode, \
- NULL::bool AS isgranted;
-
-UPDATE pg_proc SET \
- prorettype = (SELECT oid FROM pg_type \
- WHERE typname = 'pg_locks_result') \
- WHERE proname = 'pg_lock_status';
-
-CREATE VIEW pg_locks AS SELECT * FROM pg_lock_status();
+ L.relation, L.database, L.backendpid, L.mode, L.isgranted \
+ FROM pg_lock_status() AS L(relation oid, database oid, \
+ backendpid int4, mode text, isgranted boolean);
CREATE VIEW pg_settings AS \
SELECT \
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: catversion.h,v 1.153 2002/08/26 17:53:59 tgl Exp $
+ * $Id: catversion.h,v 1.154 2002/08/27 04:00:28 momjian Exp $
*
*-------------------------------------------------------------------------
*/
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 200208251
+#define CATALOG_VERSION_NO 200208271
#endif
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_proc.h,v 1.265 2002/08/26 17:53:59 tgl Exp $
+ * $Id: pg_proc.h,v 1.266 2002/08/27 04:00:28 momjian Exp $
*
* NOTES
* The script catalog/genbki.sh reads this file and generates .bki
DESCR("SET X as a function");
DATA(insert OID = 2084 ( pg_show_all_settings PGNSP PGUID 12 f f t t s 0 2249 "" show_all_settings - _null_ ));
DESCR("SHOW ALL as a function");
-DATA(insert OID = 1371 ( pg_lock_status PGNSP PGUID 12 f f f t v 0 0 "" lock_status_srf - _null_ ));
+DATA(insert OID = 1371 ( pg_lock_status PGNSP PGUID 12 f f f t v 0 2249 "" pg_lock_status - _null_ ));
DESCR("view system lock information");
DATA(insert OID = 2079 ( pg_table_is_visible PGNSP PGUID 12 f f t f s 1 16 "26" pg_table_is_visible - _null_ ));