-- Syntax encode( mddExp, formatidentifier ) encode( mddExp, formatidentifier, formatParams ) decode( mddExp ) decode( mddExp, formatParams ) -- Insert a file in the database and let the decode function figure out the type INSERT INTO rgb VALUES decode( $1 ) -- Get it out as png SELECT encode( rgb, “png” ) FROM rgb