# psycopg2.ProgrammingError: conflicting or redundant options

**URL:** <https://forum.ansible.com/t/psycopg2-programmingerror-conflicting-or-redundant-options/15767>\
**Category:** Ansible Project\
**Created:** [July 24, 2014, 5:13pm UTC](https://forum.ansible.com/t/psycopg2-programmingerror-conflicting-or-redundant-options/15767 "2014-07-24T17:13:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Oliver](https://avatars.discourse-cdn.com/v4/letter/j/97f17d/32.png) [@John\_Oliver](https://forum.ansible.com/u/John_Oliver)\
**Post date:** [July 24, 2014, 5:13pm UTC](https://forum.ansible.com/t/psycopg2-programmingerror-conflicting-or-redundant-options/15767/1 "2014-07-24T17:13:47Z")

</div>

ansible 1.6.6

This stanza in my playbook:

- name: Create database user  
postgresql\_user: name={{rc\_db\_user}}  
password={{rc\_db\_pass}}  
role\_attr\_flags=NOSUPERUSER,NOCREATEROLE,NOCREATEUSER,NOCREATEDB  
login\_user={{pg\_user}}  
login\_password={{pg\_pass}}

Results in:

TASK: [Create database user] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
failed: [jedis-test] =\> {“failed”: true, “parsed”: false}  
invalid output was: SUDO-SUCCESS-cgtcsjketcpyopmfjrlmiidxvqxogoai  
Traceback (most recent call last):  
File “/home/joliver/.ansible/tmp/ansible-tmp-1406221646.88-85343250424775/postgresql\_user”, line 1743, in   
main()  
File “/home/joliver/.ansible/tmp/ansible-tmp-1406221646.88-85343250424775/postgresql\_user”, line 499, in main  
changed = user\_add(cursor, user, password, role\_attr\_flags, encrypted, expires)  
File “/home/joliver/.ansible/tmp/ansible-tmp-1406221646.88-85343250424775/postgresql\_user”, line 181, in user\_add  
cursor.execute(query, query\_password\_data)  
psycopg2.ProgrammingError: conflicting or redundant options

I used ANSIBLE\_KEEP\_REMOTE\_FILES=1 to look at those lines, but I’m no python or postgresql guru.

---

<div class="post-metadata">

**Author:** ![John\_Oliver](https://avatars.discourse-cdn.com/v4/letter/j/97f17d/32.png) [@John\_Oliver](https://forum.ansible.com/u/John_Oliver)\
**Post date:** [July 24, 2014, 10:47pm UTC](https://forum.ansible.com/t/psycopg2-programmingerror-conflicting-or-redundant-options/15767/2 "2014-07-24T22:47:00Z")

</div>

OK, I’m going to answer my own question 🙂 I got the “conflicting or redundant options” when I used a command: It turns out that NOSUPERUSER is sufficient, and psycopg just throws a fit instead of accepting the “redundant” permissions.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [July 24, 2014, 11:39pm UTC](https://forum.ansible.com/t/psycopg2-programmingerror-conflicting-or-redundant-options/15767/3 "2014-07-24T23:39:25Z")

</div>

Yeah we should totally catch the Exception and make it look friendly in output regardless, can you file a github ticket on that?

We like to treat python tracebacks as bugs even if they are informing someone of an error condition.

Thanks!
