Index: rt_pg/rt_pg.c
===================================================================
--- rt_pg/rt_pg.c	(revision 5261)
+++ rt_pg/rt_pg.c	(working copy)
@@ -590,6 +591,33 @@
 }
 
 /**
+ * Set the SRID associated with the raster.
+ */
+PG_FUNCTION_INFO_V1(RASTER_setSRID);
+Datum RASTER_setSRID(PG_FUNCTION_ARGS)
+{
+    rt_pgraster *pgraster = (rt_pgraster *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
+    rt_raster raster;
+    rt_context ctx = get_rt_context(fcinfo);
+    int32_t newSRID = PG_GETARG_INT32(1);
+
+    /* TODO: can be optimized to only detoast the header! */
+    raster = rt_raster_deserialize(ctx, pgraster);
+    if ( ! raster ) {
+        elog(ERROR, "Could not deserialize raster");
+        PG_RETURN_NULL();
+    }
+
+    rt_raster_set_srid(ctx, raster, newSRID);
+
+    pgraster = rt_raster_serialize(ctx, raster);
+    if ( ! pgraster ) PG_RETURN_NULL();
+
+    SET_VARSIZE(pgraster, pgraster->size);
+    PG_RETURN_POINTER(pgraster);
+}
+
+/**
  * Return the width of the raster.
  */
 PG_FUNCTION_INFO_V1(RASTER_getWidth);
Index: rt_pg/rtpostgis.sql.in.c
===================================================================
--- rt_pg/rtpostgis.sql.in.c	(revision 5261)
+++ rt_pg/rtpostgis.sql.in.c	(working copy)
@@ -98,6 +98,11 @@
     AS 'MODULE_PATHNAME','RASTER_getSRID'
     LANGUAGE 'C' _IMMUTABLE_STRICT;
 
+CREATEFUNCTION st_setsrid(raster,integer)
+    RETURNS raster
+    AS 'MODULE_PATHNAME','RASTER_setSRID'
+    LANGUAGE 'C' _IMMUTABLE_STRICT;
+
 CREATEFUNCTION st_width(raster)
     RETURNS integer
     AS 'MODULE_PATHNAME','RASTER_getWidth'
Index: test/regress/Makefile.in
===================================================================
--- test/regress/Makefile.in	(revision 5261)
+++ test/regress/Makefile.in	(working copy)
@@ -28,6 +28,7 @@
 	rt_upperleft.sql \
 	rt_rotation.sql \
 	rt_georeference.sql \
+	rt_set_properties.sql \
 	$(NULL)
 
 TEST_GIST = \
Index: test/regress/rt_set_properties.sql
===================================================================
--- test/regress/rt_set_properties.sql	(revision 0)
+++ test/regress/rt_set_properties.sql	(revision 0)
@@ -0,0 +1,17 @@
+-----------------------------------------------------------------------
+-- $Id$
+--
+-- Copyright (c) 2010 David Zwarg <dzwarg@avencia.com>
+--
+-- This is free software; you can redistribute and/or modify it under
+-- the terms of the GNU General Public Licence. See the COPYING file.
+-----------------------------------------------------------------------
+
+-----------------------------------------------------------------------
+--- Test of "Set" functions for properties of the raster.
+--- (Objective B03a)
+-----------------------------------------------------------------------
+
+select 'Set SRIDs to rasters:';
+select st_srid(st_setsrid(rast,st_srid(rast)+1)) from rt_properties_test;
+
Index: test/regress/rt_set_properties_expected
===================================================================
--- test/regress/rt_set_properties_expected	(revision 0)
+++ test/regress/rt_set_properties_expected	(revision 0)
@@ -0,0 +1,5 @@
+Set SRIDs to rasters:
+11
+13
+1
+0
