Index: src/backend/utils/adt/lockfuncs.c
===================================================================
RCS file: /var/lib/cvs/pgsql-server/src/backend/utils/adt/lockfuncs.c,v
retrieving revision 1.1
diff -c -r1.1 lockfuncs.c
*** src/backend/utils/adt/lockfuncs.c	17 Aug 2002 13:11:43 -0000	1.1
--- src/backend/utils/adt/lockfuncs.c	26 Aug 2002 02:37:39 -0000
***************
*** 11,27 ****
  #include "postgres.h"
  #include "fmgr.h"
  #include "funcapi.h"
  #include "storage/lmgr.h"
  #include "storage/lock.h"
  #include "storage/lwlock.h"
  #include "storage/proc.h"
  
! Datum lock_status_srf(PG_FUNCTION_ARGS);
  
  static int next_lock(int locks[]);
  
  Datum
! lock_status_srf(PG_FUNCTION_ARGS)
  {
  	FuncCallContext		*funccxt;
  	LockData			*lockData;
--- 11,28 ----
  #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 pg_lock_status(PG_FUNCTION_ARGS);
  
  static int next_lock(int locks[]);
  
  Datum
! pg_lock_status(PG_FUNCTION_ARGS)
  {
  	FuncCallContext		*funccxt;
  	LockData			*lockData;
***************
*** 32,38 ****
  		TupleDesc		tupdesc;
  
  		funccxt = SRF_FIRSTCALL_INIT();
! 		tupdesc = RelationNameGetTupleDesc("pg_catalog.pg_locks_result");
  		funccxt->slot = TupleDescGetSlot(tupdesc);
  		funccxt->attinmeta = TupleDescGetAttInMetadata(tupdesc);
  
--- 33,50 ----
  		TupleDesc		tupdesc;
  
  		funccxt = SRF_FIRSTCALL_INIT();
! 		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);
  
Index: src/bin/initdb/initdb.sh
===================================================================
RCS file: /var/lib/cvs/pgsql-server/src/bin/initdb/initdb.sh,v
retrieving revision 1.168
diff -c -r1.168 initdb.sh
*** src/bin/initdb/initdb.sh	17 Aug 2002 15:12:07 -0000	1.168
--- src/bin/initdb/initdb.sh	26 Aug 2002 02:37:39 -0000
***************
*** 977,996 ****
              pg_stat_get_db_blocks_hit(D.oid) AS blks_hit \
      FROM pg_database D;
  
! CREATE VIEW pg_locks_result 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();
  
  CREATE VIEW pg_settings AS \
      SELECT \
--- 977,987 ----
              pg_stat_get_db_blocks_hit(D.oid) AS blks_hit \
      FROM pg_database D;
  
! CREATE VIEW pg_locks AS \
  	SELECT \
! 		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 \
Index: src/include/catalog/catversion.h
===================================================================
RCS file: /var/lib/cvs/pgsql-server/src/include/catalog/catversion.h,v
retrieving revision 1.152
diff -c -r1.152 catversion.h
*** src/include/catalog/catversion.h	24 Aug 2002 15:00:46 -0000	1.152
--- src/include/catalog/catversion.h	26 Aug 2002 02:37:40 -0000
***************
*** 53,58 ****
   */
  
  /*							yyyymmddN */
! #define CATALOG_VERSION_NO	200208231
  
  #endif
--- 53,58 ----
   */
  
  /*							yyyymmddN */
! #define CATALOG_VERSION_NO	200208251
  
  #endif
Index: src/include/catalog/pg_proc.h
===================================================================
RCS file: /var/lib/cvs/pgsql-server/src/include/catalog/pg_proc.h,v
retrieving revision 1.264
diff -c -r1.264 pg_proc.h
*** src/include/catalog/pg_proc.h	23 Aug 2002 16:41:37 -0000	1.264
--- src/include/catalog/pg_proc.h	26 Aug 2002 02:37:40 -0000
***************
*** 2902,2908 ****
  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_ ));
  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_ ));
--- 2902,2908 ----
  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 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_ ));
