I'm looking to store a huge raster aerial image (400 Gb) into Postgis, but before storing it i like to know how i could georeference or rectify raster stored in postgis ? is there any Qgis plugins like georeferencer, but could read in-database-raster or any other software ? any hints ?
For that kind of dataset I would argue that would be un-wise and try to reproject-on-the-fly.
It can be done with ST_Transform(rast), but if you want to go that road be sure to include spatial extents (rast type can be casted to geom type).
As aerial images are mostly for viewing I would suggest to consider using an intermediate step by using a TileService service to deliver your image.
You can configure the WMTS' gridset to be in whatever CRS you want it to be.
If you want that solution the general workflow would be like this:
POSTGIS RASTER -> WMS Service -> TMS Service -> Client
It depends what you mean with georeferencing. There actually is the ST_Georeference function which doesn't change the raster itself, it simply defines where the raster is located in space by setting 6 offset/scale/skew coefficients. As mentioned by @JohnBarça, your raster should have the proper georeferencing metadata, but sometimes it doesnt, and that is when you have to define it yourself.
This is different from the ST_Transform which is more like reprojecting and actually changing the data values.
Note however, given the size of your raster I assume your raster is tiled (ie chopped up into several tiles/subrasters, where each row in your database table represents one of these tiles). ST_Georeference like all other PostGIS functions work on each individual row/tile (not on your entire raster as a whole), so you will have to think it through thoroughly to give the correct georeferencing to each tile.