Update:
I saw this discussion on Tilemill. The guy there is trying to use a raster from PostGIS as a data source. Tilemill uses Mapnik to render the tiles. I will quote Dane ( Tilemill support staff):
Hi Craig,
The PostGIS support in TileMill is (currently) only designed to be vector based. The raster storage in PostGIS is a very new feature of PostGIS - we may support it in the future but not at this point.
Raster support in TileMill is all through Mapnik's GDAL plugin. It may be possible to setup up Mapnik and GDAL to read rasters out of PostGIS, but I've not personally tried this yet. In TileMill the assumption is all rasters are simple a file on the filesystem at this point.
There is also this discussion from the Mapnik forum. This one is a response to the same question that you are asking right now:
I've never seen this done. Does GDAL support postgis raster yet? I know pg_raster uses GDAL internally, so I figure it should.
We plan to add a new mapnik plugin eventually to read directly from pg_raster.
Dane
That one's dated August 23, 2012. Chances are, things haven't changed much since then. You might have to use use the GeoTIFFS and GDAL for now. Hopefully they'll release the pg_raster support for Mapnik soon.
Found this sample snippet on the Mapnik wiki.
<Datasource> <Parameter name="type">postgis</Parameter> <Parameter name="host">localhost</Parameter> <Parameter name="dbname">geodjango_geographic_admin</Parameter> <Parameter name="user">postgres</Parameter> <Parameter name="password"></Parameter> <Parameter name="table">(select ST_Buffer(ST_Centroid(geometry),2) as geometry, name from world_worldborders) as world</Parameter> <Parameter name="estimate_extent">false</Parameter> <Parameter name="extent">-180,-90,180,89.99</Parameter> </Datasource>
I guess you're missing the user and password parameters. Without those, Mapnik can't connect to the PostGIS database. Therefore, nothing is rendered.
The Mapnik wiki page on PostGIS might be the documentation you're looking for. I hope that helps.