First of all I started learning Elixir about 2 months ago on my spare time (which I don’t have a lot of unfortunately), so my apologies if my question has an obvious answer.
I am having a hard time defining a column ‘pg_catalog.”default”’ collation in a migration file (for Postgres).
This sample code:
create table(:some_table, primary_key: false) do
add :first_name, :text, null: false, collation: "pg_catalog.\"default\""
end
results in this error:
** (Postgrex.Error) ERROR 42601 (syntax_error) zero-length delimited identifier at or near """"
I think this is because the resulting “CREATE TABLE” query contains the following:
"first_name" text NOT NULL COLLATE "pg_catalog."default"",
I am able to work around this issue by removing the ‘collation’ definition and replacing with an ‘execute’ statement:
execute("ALTER TABLE some_table ALTER COLUMN first_name SET DATA TYPE text COLLATE pg_catalog.\"default\""")
It is a bit annoying. Is there a way to get ‘collation’ to work in this case?
Thanks.




















