postgresql7.1 select rulename, definition from pg_rules where tablename ='$table' ORDER BY rulename;