# postgresql\_db for Windows?

**URL:** <https://forum.ansible.com/t/postgresql-db-for-windows/35349>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [June 15, 2021, 11:39am UTC](https://forum.ansible.com/t/postgresql-db-for-windows/35349 "2021-06-15T11:39:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZillaYT](https://avatars.discourse-cdn.com/v4/letter/z/4da419/32.png) [@ZillaYT](https://forum.ansible.com/u/ZillaYT)\
**Post date:** [June 15, 2021, 11:39am UTC](https://forum.ansible.com/t/postgresql-db-for-windows/35349/1 "2021-06-15T11:39:06Z")

</div>

Is there an equivalent Windows module for postgresql\_db in Windows that I can use to dump/restore a PostgreSQL DB?

Thanks,  
Chris

---

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [June 15, 2021, 11:44am UTC](https://forum.ansible.com/t/postgresql-db-for-windows/35349/2 "2021-06-15T11:44:52Z")

</div>

No. But the commands on linux should be able to reach out to a remote host. Can you delegate locally and reach out to remote windows host?  
[https://docs.ansible.com/ansible/latest/collections/community/postgresql/postgresql\_db\_module.html#ansible-collections-community-postgresql-postgresql-db-moduleThere](https://docs.ansible.com/ansible/latest/collections/community/postgresql/postgresql_db_module.html#ansible-collections-community-postgresql-postgresql-db-moduleThere) is an proc there to specify a login host. That’s the host running the database.

---

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [June 15, 2021, 11:50am UTC](https://forum.ansible.com/t/postgresql-db-for-windows/35349/3 "2021-06-15T11:50:57Z")

</div>

I Should say option

---

<div class="post-metadata">

**Author:** ![ZillaYT](https://avatars.discourse-cdn.com/v4/letter/z/4da419/32.png) [@ZillaYT](https://forum.ansible.com/u/ZillaYT)\
**Post date:** [June 15, 2021, 12:46pm UTC](https://forum.ansible.com/t/postgresql-db-for-windows/35349/4 "2021-06-15T12:46:40Z")

</div>

Thanks. I’ve seen that link before, but the page does not provide an example that uses “login\_host”? Is just the hostname, or IP address, or the host running the DB? What about the PostgreSQL cred and connection URL? I don’t see them in the module?

Thanks,  
Chris

---

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [June 15, 2021, 12:52pm UTC](https://forum.ansible.com/t/postgresql-db-for-windows/35349/5 "2021-06-15T12:52:41Z")

</div>

Googling around I found this example:

[Ansible Loves PostgreSQL - 2ndQuadrant | PostgreSQL](https://www.2ndquadrant.com/en/blog/ansible-loves-postgresql/)

looks like name is what you are looking for

```auto
- postgresql_db: name=module_test
                 state=present
                 login_host=[db.example.com](http://db.example.com)
                 port=5432
                 login_user=postgres

```

---

<div class="post-metadata">

**Author:** ![ZillaYT](https://avatars.discourse-cdn.com/v4/letter/z/4da419/32.png) [@ZillaYT](https://forum.ansible.com/u/ZillaYT)\
**Post date:** [June 15, 2021, 1:23pm UTC](https://forum.ansible.com/t/postgresql-db-for-windows/35349/6 "2021-06-15T13:23:40Z")

</div>

Thanks again. I’ll try it later and post here.

Chris
