     repo = ecto_repo()
 
     transaction_fn = case db_type(repo) do
-      :postgres -> &transaction_with_lock_postgres/2
+      :postgres -> build_transaction_with_lock_postgres_fn(flag_name)
       :mysql -> &transaction_with_lock_mysql/2
     end
 

  end


  defp transaction_with_lock_postgres(repo, upsert_fn) do
    repo.transaction fn() ->
      postgres_table_lock!(repo)
      upsert_fn.()
    end
  end

  defp transaction_with_lock_mysql(repo, upsert_fn) do
    repo.transaction fn() ->
      if mysql_lock!(repo) do

  alias FunWithFlags.Store.Persistent.Ecto.Record
  alias FunWithFlags.Store.Serializer.Ecto, as: Serializer

  import FunWithFlags.Config, only: [ecto_repo: 0]
  import Ecto.Query

  require Logger
