# How to create PostgreSQL database?

**URL:** https://community.zammad.org/t/how-to-create-postgresql-database/14695
**Category:** Technical assistance
**Created:** [June 20, 2024, 4:01pm UTC](https://community.zammad.org/t/how-to-create-postgresql-database/14695 "2024-06-20T16:01:09Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![fluca1978](https://community.zammad.org/user_avatar/community.zammad.org/fluca1978/32/9236_2.png) [@fluca1978](https://community.zammad.org/u/fluca1978)
#### Post date: [June 24, 2024, 8:29am UTC](https://community.zammad.org/t/how-to-create-postgresql-database/14695/3 "2024-06-24T08:29:52Z")

</div>

I’ve tried to manually create the PostgreSQL database:

```auto
postgres=# create role zammad with login password '<the password from database.yml>';

postgres=# create database zammad with owner zammad;

```

and verified that the `zammad` operating system user can connect:

```auto
ammad@zammad-test:~$ id
uid=999(zammad) gid=996(zammad) gruppi=996(zammad)
zammad@zammad-test:~$ psql -c 'select current_date; ' zammad
 current_date 
--------------
 2024-06-24
(1 riga)

```

With the database in place, things go a little better but the installation still complains:

```auto
# apt install zammad
...
== 20240612071836 CleanupObsoleteTranslations: migrating ======================
== 20240612071836 CleanupObsoleteTranslations: migrated (0.0004s) =============

# Updating translations...
/opt/zammad/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/postgresql_adapter.rb:768:in `exec_params': PG::ForeignKeyViolation: ERROR: insert or update on table "translations" violates foreign key constraint "fk_rails_d6e6d9635d" (ActiveRecord::InvalidForeignKey)
DETAIL: Key (created_by_id)=(1) is not present in table "users".

```

Just for the record:

```auto
# apt search zammad
Ordinamento... Fatto
Ricerca sul testo... Fatto
zammad/sconosciuto,now 6.3.1-1719208095.8ca3e48a.bookworm amd64 [installato]
  Zammad is a web based open source helpdesk/customer support system

```

---

_[View the full topic](https://community.zammad.org/t/how-to-create-postgresql-database/14695)._
