first try, dialect 'postgres'
simple structured code