proc getCols {} {

	global DB pgHan pgCt sybmsg PGtypes

	set cols ""
	set found ""

	case $DB in {
	{SYB} {
		set flds [sybCols 1]
		set lens $sybmsg(collengths)
		set typs $sybmsg(coltypes)
		set i 0
		foreach c $flds {
			if {$c == ""} { set c C$i }
			if {[lsearch $found $c] >= 0} {
				set c ${c}_$i
			}
			set l [lvarpop lens]
			set t [lvarpop typs]
			keylset cols $c "$t $l"
			lappend found $c
			incr i
		}
	}
	{PG} {
      		set att_list [pgCols $pgHan]
		set i 0
		foreach a $att_list {
			set cn [lindex $a 0]
			if {$cn == ""} { set cn C$i }
                	if {[lsearch $found $c] >= 0} {
                		set c ${c}_$i
               	 	}
			set ct [keylget PGtypes([lindex $a 1]) typname]
			set cl [lindex $a 2]
#		TEMPORARY hardwire
			if {$cl < 0} {
				set cl 32
			}
			keylset cols $cn "$ct $cl"
			lappend found $c
			incr i
		}
	}
	{default} {
		puts stderr "Sorry, Oracle not supported yet."
	}
	}
#	puts stderr "returning cols: $cols"
	return "$cols"

}
