I created a function in PostgreSQL to transform input coordinates using UTM Zone 12/13, with Datums NAD83 or NAD27, to the WYLAM projection. I had to manually create the entry for the proj4text column for WYLAM, because it is missing from SpatialReference.org. The function works just fine when transforming from UTM Zone 13 NAD83 (EPSG: 3743) to WYLAM, for example, but if I try to transform from UTM Zone 13 NAD27 (EPSG: 26713) to WYLAM, the resulting point is about 50m east and 4m north of where it should be. This is what I would expect for a NAD27/NAD83 conflict in my area (Wyoming). I get the same type of error with input coordinates for other UTM zones and for unprojected decimal degrees when using the NAD27 datum and going to WYLAM with NAD83 datum.
I defined the proj4text column as:
+proj=lcc +lat_1=41 +lat_2=45 +lat_0=41 +lon_0=-107.5 +k_0=1 +x_0=500000 +y_0=200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
QGIS seems to perform a conversion from UTM Zone 12N NAD27 to WYLAM (NAD83) just fine, and as far as I can tell, all the parameters it has for the two projections are the same as what I'm using in PostgreSQL.
I reviewed this question, and the associated answers and links, but it's not clear to me that this provides any useful information for my problem.
I have also tried converting from UTM Zone 13N NAD83 to UTM Zone 13N NAD27, and going both directions (NAD83 to NAD27) with unprojected (decimal degrees) data, and wind up with the same error. It seems like PostGIS is missing the nadgrid/nadcon information needed to transform between datums accurately.
What am I missing?