Can you explain a little more what you mean here? I'm not sure this helps my use case. E.g. if I run a BQ external query like the following
SELECT * FROM EXTERNAL_QUERY("my-pg-connection-string", """
SELECT enum_column FROM foo;
""");
that always fails for me, even if I define "CREATE CAST (my_enum_type AS text) WITH INOUT AS IMPLICIT;"
The only way I can get it to work is if I use "SELECT enum_column::text FROM foo;" and I don't need a custom cast definition to do that.