<!--- Verify first that your issue is not already reported on GitHub -->
<!--- Also test if the latest release and devel branch are affected too -->
<!--- Complete *all* sections as described, this form is processed automatically -->

##### SUMMARY
The `postgres_user` module does not commit changes if the variable groups is set. The create action will be commited, but any changes after that which do not change the `groups` variable will not be commited. This is due to [this line](https://github.com/ansible/ansible/blob/80bf24b17c52546c081b27e639499ba128824cf3/lib/ansible/modules/database/postgresql/postgresql_user.py#L855) which overrides the changed variable regardless of hte previous settings

##### ISSUE TYPE
- Bug Report

##### COMPONENT NAME
`postgres_user`

##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes -->
```paste below
prod@ansible # ansible --version
ansible 2.9.0
  config file = /root/ansible.cfg
  configured module search path = [u'/root/galaxy_roles/kafka_lib/library']
  ansible python module location = /root/env/local/lib/python2.7/site-packages/ansible
  executable location = /root/env/bin/ansible
  python version = 2.7.12 (default, Oct  8 2019, 14:14:10) [GCC 5.4.0 20160609]

```

##### CONFIGURATION
<!--- Paste verbatim output from "ansible-config dump --only-changed" between quotes -->
```paste below
ANSIBLE_PIPELINING(/root/ansible.cfg) = True
ANSIBLE_SSH_RETRIES(/root/ansible.cfg) = 3
CACHE_PLUGIN(/root/ansible.cfg) = jsonfile
CACHE_PLUGIN_CONNECTION(/root/ansible.cfg) = /root/.ansible_jsonfile_cache
CACHE_PLUGIN_TIMEOUT(/root/ansible.cfg) = 86400000
DEFAULT_GATHERING(/root/ansible.cfg) = smart
DEFAULT_MODULE_PATH(env: ANSIBLE_LIBRARY) = [u'/root/galaxy_roles/kafka_lib/library']
HOST_KEY_CHECKING(env: ANSIBLE_HOST_KEY_CHECKING) = False
```

##### OS / ENVIRONMENT
Tested on mac and linux 


##### STEPS TO REPRODUCE
Run the following:

```yaml
- name: Create read group
  postgresql_user:
    name: read
    role_attr_flags: NOLOGIN
    state: present
  become: yes
  become_user: postgres

- name: Create/grant postgres user
  postgresql_user:
    name: some_user
    state: present
    groups: [read]
    password: abc123
  become: yes
  become_user: postgres
```

Then change something (such as password) without changing groups:
```yaml
- name: Create/grant postgres user
  postgresql_user:
    name: some_user
    state: present
    groups: [read]
    password: abc1234
  become: yes
  become_user: postgres
```
And run the playbook again. The play will be reported as `changed: false` and the password will not be updated.



##### EXPECTED RESULTS
Changes are commited without changing the groups var


##### ACTUAL RESULTS

Changes are only commited if the groups var is changed.
"""
    Return the difference between the privileges that a user already has and
    the privileges that they desire to have.
    :returns: tuple of:
        * privileges that they have and were requested
        * privileges they currently hold but were not requested
        * privileges requested that they do not hold
    """
    cur_privs = get_table_privileges(cursor, user, table)
    have_currently = cur_privs.intersection(privs)
    other_current = cur_privs.difference(privs)
    desired = privs.difference(cur_privs)
    return (have_currently, other_current, desired)
def get_table_privileges(cursor, user, table):
    if '.' in table:
        schema, table = table.split('.', 1)
    else:
        schema = 'public'
    query = ("SELECT privilege_type FROM information_schema.role_table_grants "
             "WHERE grantee='%s' AND table_name='%s' AND table_schema='%s'" % (user, table, schema))
    cursor.execute(query)
    return frozenset([x[0] for x in cursor.fetchall()])
def grant_table_privileges(cursor, user, table, privs):
    
    privs = ', '.join(privs)
    query = 'GRANT %s ON TABLE %s TO "%s"' % (
        privs, pg_quote_identifier(table, 'table'), user)
    executed_queries.append(query)
    cursor.execute(query)
def revoke_table_privileges(cursor, user, table, privs):