postgis/extras/WFS_locks
2022-07-25 14:01:44 -07:00
..
Makefile Removed compiler warnings (and more requested) 2006-06-24 01:08:29 +00:00
README Added EnableLongTransactions() and DisableLongTransactions(). 2006-06-23 23:37:18 +00:00
test.sql Formatting: remove trailing whitespace from .sql files. 2018-01-17 20:39:03 +00:00
WFS_locks.c Move to using snprintf for fixed length buffers. 2022-07-25 14:01:44 -07:00
WFS_locks.sql.in Formatting: remove trailing whitespace from .sql files. 2018-01-17 20:39:03 +00:00

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:
	
	-- Enable long transaction support
	SELECT EnableLongTransactions();

	-- Disable long transaction support
	SELECT DisableLongTransactions();

	-- 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;