postgresql7.1 select site_node__url(site_nodes.node_id) from site_nodes where site_nodes.object_id = :package_id select to_char(now(), :date_format) select bulk_mail_messages.* from bulk_mail_messages where bulk_mail_messages.status = 'pending' and bulk_mail_messages.send_date <= now() for update