
Thu Mar 24 17:25:48 CET 2005
----------------------------

This module and associated pl/pgsql functions have been implemented
to provide long locking support required by Web Feature Service
specification (https://portal.opengeospatial.org/files/?artifact_id=7176)

It is based on original work by David Blasby <dblasby@openplans.org>
and has been modified and packaged by Sandro Santilli <strk@refractions.net>.


  Usage:
	
	-- Check updates and deletes of rows in
	-- given table for being authorized.
	-- Identify rows using <column> value.
	SELECT CheckAuth([<schema>], <table>, <column>)

	-- Set lock/authorization for specific row in table
	-- <authid> is a text value, <expires> is a timestamp
	-- defaulting to now()+1hour.
	-- Returns 1 if lock has been assigned, 0 otherwise
	-- (already locked by other auth)
	SELECT LockRow([<schema>], <table>, <rowid>, <authid>, [<expires>])

	-- Remove all locks held by specified authorization id.
	-- Returns the number of locks released.
	SELECT UnlockRows(<authid>)

	-- Add an authorization token to be used in current
	-- transaction. 
	SELECT AddAuth(<authid>)

  WARNING! users must use serializable transaction level
  (see http://www.postgresql.org/docs/7.4/static/transaction-iso.html)
  otherwise locking mechanism would break
  
  
	--strk;
