I saw this helper function uniquify and it looks like you are manually creating unique symbols. Julia provides a builtin for that called gensym which makes symbols.
julia> gensym("foo")
Symbol("##foo#253")
it looks like you can't use #
in SQL identifiers, so maybe gensym and then replace would work like:
replace(gensym(tag), "#"=>"_")