# Line order v2.2 pg\_hba.conf

**URL:** <https://forums.percona.com/t/line-order-v2-2-pg-hba-conf/24026>\
**Category:** Percona Operator for PostgreSQL\
**Tags:** closed-no-reply\
**Created:** [July 30, 2023, 6:47am UTC](https://forums.percona.com/t/line-order-v2-2-pg-hba-conf/24026 "2023-07-30T06:47:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sergey\_Zhuravlev](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/sergey_zhuravlev/32/6410_2.png) [@Sergey\_Zhuravlev](https://forums.percona.com/u/Sergey_Zhuravlev)\
**Post date:** [July 30, 2023, 6:47am UTC](https://forums.percona.com/t/line-order-v2-2-pg-hba-conf/24026/1 "2023-07-30T06:47:48Z")

</div>

## Description:

How to rewrite pg\_hba.conf completely in v2.2 or insert lines at the beginning?

When using the corresponding section in the cr.yaml, the lines are added to the end of those that are already set by default.

## Steps to Reproduce:

```auto
  patroni:
    dynamicConfiguration:
      postgresql:
        parameters:
          shared_preload_libraries: pg_cron,pg_stat_monitor,pgaudit,pg_stat_statements
          krb_server_keyfile: postgres.keytab
          cron.database_name: postgres
          track_io_timing: on
         
        pg_hba:                                                                                                                                     
        - local all postgres trust

```

## Version:

v2.2

---

<div class="post-metadata">

**Author:** ![RBos](https://avatars.discourse-cdn.com/v4/letter/r/b3f665/32.png) [@RBos](https://forums.percona.com/u/RBos)\
**Post date:** [February 12, 2025, 10:23am UTC](https://forums.percona.com/t/line-order-v2-2-pg-hba-conf/24026/2 "2025-02-12T10:23:44Z")

</div>

I’m running into the same issue, lines are appended to the end of the file, whilst the file has a top down approach…making it not possible to secure access through this pg\_hba.conf file.  
I’m curious to the solution or workaround @Sergey_Zhuravlev.

---

<div class="post-metadata">

**Author:** ![Jobin\_Augustine](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/jobin_augustine/32/1275_2.png) [@Jobin\_Augustine](https://forums.percona.com/u/Jobin_Augustine)\
**Post date:** [February 12, 2025, 6:18pm UTC](https://forums.percona.com/t/line-order-v2-2-pg-hba-conf/24026/3 "2025-02-12T18:18:16Z")

</div>

To the best of my knowledge  
Currently, this is not possible because the operator manages the first entries by default.  
But this might be implemented in future because there is a JIRA item existing.  
[https://perconadev.atlassian.net/browse/K8SPG-712](https://perconadev.atlassian.net/browse/K8SPG-712)
