changed pglisttables to sql version