// Added by Stefan Andreasen <stefan@linux.kapow.dk>
// If the pattern are null then set them to %
if(tableNamePattern==null)tableNamePattern="%";
if(columnNamePattern==null)columnNamePattern="%";
// Now form the query
// Modified by Stefan Andreasen <stefan@linux.kapow.dk>
r=connection.ExecSQL("select a.oid,c.relname,a.attname,a.atttypid,a.attnum,a.attnotnull,a.attlen,a.atttypmod from pg_class c, pg_attribute a where a.attrelid=c.oid and c.relname like '"+tableNamePattern.toLowerCase()+"' and a.attname like '"+columnNamePattern.toLowerCase()+"' and a.attnum>0 order by c.relname,a.attnum");
byteremarks[];
while(r.next()){
byte[][]tuple=newbyte[18][0];
// Fetch the description for the table (if any)
java.sql.ResultSetdr=connection.ExecSQL("select description from pg_description where objoid="+r.getInt(1));
java.sql.ResultSetr=connection.ExecSQL("SELECT relname, relacl FROM pg_class, pg_user WHERE ( relkind = 'r' OR relkind = 'i') and relname !~ '^pg_' and relname !~ '^xin[vx][0-9]+' and usesysid = relowner and relname like '"+table.toLowerCase()+"' ORDER BY relname");