Examples: 7.11 Long Transactions Support
Examples: 7.11 Long Transactions Support
1 Manual
251 / 315
Examples
SELECT ST_AsEWKT(ST_AddMeasure(
ST_GeomFromEWKT(LINESTRING(1 0, 2 0, 4 0)),1,4)) As ewelev;
ewelev
-------------------------------LINESTRINGM(1 0 1,2 0 2,4 0 4)
SELECT ST_AsEWKT(ST_AddMeasure(
ST_GeomFromEWKT(LINESTRING(1 0 4, 2 0 4, 4 0 4)),10,40)) As ewelev;
ewelev
---------------------------------------LINESTRING(1 0 4 10,2 0 4 20,4 0 4 40)
SELECT ST_AsEWKT(ST_AddMeasure(
ST_GeomFromEWKT(LINESTRINGM(1 0 4, 2 0 4, 4 0 4)),10,40)) As ewelev;
ewelev
---------------------------------------LINESTRINGM(1 0 10,2 0 20,4 0 40)
SELECT ST_AsEWKT(ST_AddMeasure(
ST_GeomFromEWKT(MULTILINESTRINGM((1 0 4, 2 0 4, 4 0 4),(1 0 4, 2 0 4, 4 0 4))),10,70)) As ewelev;
ewelev
----------------------------------------------------------------MULTILINESTRINGM((1 0 10,2 0 20,4 0 40),(1 0 40,2 0 50,4 0 70))
Note
Users must use serializable transaction level otherwise locking mechanism would break.
7.11.1 AddAuth
Name
AddAuth Add an authorization token to be used in current transaction.
Synopsis
boolean AddAuth(text auth_token);
Description
Add an authorization token to be used in current transaction.
Creates/adds to a temp table called temp_lock_have_table the current transaction identifier and authorization token key.
Availability: 1.1.3
Examples
SELECT LockRow(towns, 353, priscilla);
BEGIN TRANSACTION;
SELECT AddAuth(joey);
UPDATE towns SET the_geom = ST_Translate(the_geom,2,2) WHERE gid = 353;
COMMIT;
See Also
LockRow
7.11.2 CheckAuth
Name
CheckAuth Creates trigger on a table to prevent/allow updates and deletes of rows based on authorization token.
Synopsis
integer CheckAuth(text a_schema_name, text a_table_name, text a_key_column_name);
integer CheckAuth(text a_table_name, text a_key_column_name);
Description
Creates trigger on a table to prevent/allow updates and deletes of rows based on authorization token. Identify rows using
<rowid_col> column.
If a_schema_name is not passed in, then searches for table in current schema.
Note
If an authorization trigger already exists on this table function errors.
If Transaction support is not enabled, function throws an exception.
Availability: 1.1.3
Examples
SELECT CheckAuth(public, towns, gid);
result
-----0
See Also
EnableLongTransactions