{"result":{"depiction_url":null,"edges":{"relation":{"objects":[{"created":"2026-10-07T11:13:13Z","object_id":{"id":3045,"is_a":["text","documentation","developerguide"],"name":"developer_local_postgresql","title":{"_type":"trans","tr":{"en":"Prepare local PostgreSQL"}},"uri":"https:\/\/zotonic.com\/id\/3045"},"seq":1},{"created":"2026-10-07T11:13:13Z","object_id":{"id":3065,"is_a":["text","documentation","adminguide"],"name":"admin_persistent_settings","title":{"_type":"trans","tr":{"en":"Change persistent configuration"}},"uri":"https:\/\/zotonic.com\/id\/3065"},"seq":2},{"created":"2026-10-07T11:13:13Z","object_id":{"id":3080,"is_a":["text","documentation","adminguide"],"name":"admin_startup_failures","title":{"_type":"trans","tr":{"en":"Diagnose a site that will not start"}},"uri":"https:\/\/zotonic.com\/id\/3080"},"seq":3}],"predicate":{"id":303,"is_a":["meta","predicate"],"name":"relation","title":{"_type":"trans","tr":{"nl":"Relatie","en":"Relation"}},"uri":"http:\/\/purl.org\/dc\/terms\/relation"}},"subject":{"objects":[{"created":"2026-10-07T11:13:13Z","object_id":{"id":2554,"is_a":["categorization","keyword","keyword_information_type"],"name":"zotonic_topic_how_to_guide","title":"How-to guide","uri":"https:\/\/zotonic.com\/id\/2554"},"seq":1},{"created":"2026-10-07T11:13:13Z","object_id":{"id":2566,"is_a":["categorization","keyword","keyword_audience"],"name":"zotonic_topic_operator","title":"Operator","uri":"https:\/\/zotonic.com\/id\/2566"},"seq":2},{"created":"2026-10-07T11:13:13Z","object_id":{"id":2631,"is_a":["categorization","keyword","keyword_architecture"],"name":"zotonic_topic_database","title":"Database","uri":"https:\/\/zotonic.com\/id\/2631"},"seq":3},{"created":"2026-10-07T11:13:13Z","object_id":{"id":2671,"is_a":["categorization","keyword","keyword_technology"],"name":"zotonic_topic_postgresql","title":"PostgreSQL","uri":"https:\/\/zotonic.com\/id\/2671"},"seq":4},{"created":"2026-10-07T11:13:13Z","object_id":{"id":2603,"is_a":["categorization","keyword","keyword_domain"],"name":"zotonic_topic_configuration","title":"Configuration","uri":"https:\/\/zotonic.com\/id\/2603"},"seq":5}],"predicate":{"id":308,"is_a":["meta","predicate"],"name":"subject","title":{"_type":"trans","tr":{"en":"Keyword"}},"uri":"http:\/\/purl.org\/dc\/elements\/1.1\/subject"}}},"id":3070,"is_a":["text","documentation","adminguide"],"links":[{"rel":"self","target":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/3070"},{"rel":"hub","target":"https:\/\/zotonic.com\/.zotonic\/websub"}],"medium":null,"medium_url":null,"name":"admin_database_connection","page_url":{"en":"https:\/\/zotonic.com\/docs\/3070\/check-or-change-a-site-database-connection","x-default":"https:\/\/zotonic.com\/docs\/3070\/check-or-change-a-site-database-connection"},"preview_url":null,"resource":{"body":{"_type":"trans","tr":{"en":"<p><strong>Access needed:<\/strong> Database and server configuration access.<\/p>\n<ol><li>Identify the site&#39;s effective database host, port, database name, role, and schema. Do not print the password into a shared report.<\/li><li>Test connectivity from the same host or container that runs Zotonic. A successful connection from your laptop may follow a different route.<\/li><li>Check authentication and the role&#39;s access to the intended database and schema.<\/li><li>Make a required connection change in acceptance first, at the owning configuration layer.<\/li><li>Restart or reload according to the deployment procedure and check startup logs.<\/li><li>Verify an existing page and a small write using the intended site account. Confirm that you did not connect to an empty or wrong environment&#39;s database.<\/li><\/ol>\n<p>A schema separates site tables within a database; it is not a substitute for environment isolation. Do not grant superuser rights to bypass a permissions error. For a fresh local development database, use the developer setup task instead of adapting production credentials.<\/p>\n<h2>Local socket connections<\/h2>\n<p>For PostgreSQL on the same host, set <code>dbhost<\/code> to <code>socket<\/code> (atom, string, or binary) to use <code>\/run\/postgresql<\/code>, or set it to an absolute socket directory. <code>dbport<\/code> selects <code>.s.PGSQL.&lt;port&gt;<\/code>, normally <code>.s.PGSQL.5432<\/code>. This mode does not fall back to TCP.<\/p>\n<p>Check <code>SHOW unix_socket_directories;<\/code> in PostgreSQL and test with <code>psql -h \/run\/postgresql -p 5432 -U ROLE -d DATABASE<\/code> as the Zotonic service user. Socket connections use <code>local<\/code> rules in <code>pg_hba.conf<\/code>; TCP connections use <code>host<\/code> rules. Match the intended password or peer-authentication policy. Keep the socket directory writable only by trusted users. For containers, verify the mount and permissions inside the container.<\/p>"}},"category_id":{"id":2773,"is_a":["meta","category"],"name":"adminguide","title":"Administration guide","uri":"https:\/\/zotonic.com\/id\/adminguide"},"content_group_id":{"id":339,"is_a":["meta","content_group"],"name":"default_content_group","title":{"_type":"trans","tr":{"en":"Default Content Group"}},"uri":"https:\/\/zotonic.com\/id\/default_content_group"},"created":"2026-10-07T11:12:59Z","creator_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"doc_editorial_bundle":true,"doc_editorial_edges":{"relation":[3045,3065,3080],"subject":[2554,2566,2603,2631,2671]},"is_authoritative":true,"is_dependent":false,"is_featured":false,"is_protected":false,"is_published":true,"is_unfindable":false,"language":["en"],"modified":"2026-10-07T11:13:14Z","modifier_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"name":"admin_database_connection","pivot_geocode":null,"pivot_location_lat":null,"pivot_location_lng":null,"privacy":0,"publication_end":"9999-06-01T00:00:00Z","publication_start":"2026-10-07T11:12:59Z","slug":"check-or-change-a-site-database-connection","summary":{"_type":"trans","tr":{"en":"Verify host, role, database, and schema before restarting a site."}},"title":{"_type":"trans","tr":{"en":"Check or change a site database connection"}},"title_slug":{"_type":"trans","tr":{"en":"check-or-change-a-site-database-connection"}},"tz":"UTC","uri":null,"version":20,"visible_for":0},"uri":"https:\/\/zotonic.com\/id\/3070","uri_template":"https:\/\/zotonic.com\/id\/:id","websub":{"hub":"https:\/\/zotonic.com\/.zotonic\/websub","topic":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/3070"}},"status":"ok"}