Gelato_Candy

Gelato_Candy

[SOLVED] Phoenix ecto mismatch collation

hi my latest phoenix and elixir, psql (PostgreSQL) 15.3 (Debian 15.3-1.pgdg110+1)
had an issue

it always ** (Mix) The database for MyApp.Repo couldn’t be created: ERROR XX000 (internal_error) template database “template1” has a collation version mismatch
but there’s no “template1” database in my psql, and i dont even create that database before

hint: Rebuild all objects in the template database that use the default collation and run ALTER DATABASE template1 REFRESH COLLATION VERSION, or build PostgreSQL with the right library version.                                 

The template database was created using collation version 2.36, but the operating system provides version 2.37.

when i try to run mix ecto.create and also all my previous database project had and warning about the collation version mismatch, because of that,i cant run mix ecto , so i cant add or create or update new database for my project

Marked As Solved

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

Again this isn’t about ecto. Your postgres is broken and you need to fix it before ecto can connect to it. You need to use psql. Go to your terminal and type psql template1.

See: https://dba.stackexchange.com/questions/324649/collation-version-mismatch

Also Liked

Gelato_Candy

Gelato_Candy

oh my god, its so simple than i thought

ALTER DATABASE template1 REFRESH COLLATION VERSION;
NOTICE: changing version from 2.36 to 2.37

thankyou so much, really appreciate

Where Next?

Popular in Questions Top

skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lists...
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

Other popular topics Top

New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 42920 311
New
chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 39297 209
New

Latest on Elixir Forum

We're in Beta

About us Mission Statement