diff options
author | Andrew Klychkov <aaklychkov@mail.ru> | 2021-02-05 20:39:15 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-05 11:39:15 -0600 |
commit | 6f4ea2f19e25847ef44de543f6f5d83d701a3c34 (patch) | |
tree | ea3f0d1e0d5876998c47826e48ac8d3c57497ec7 /test/integration/targets | |
parent | d8a82154d439cfacf12c8e186ddcc74781b667fb (diff) | |
download | ansible-6f4ea2f19e25847ef44de543f6f5d83d701a3c34.tar.gz |
postgresql_query: fix decimal handling (#73414)
Co-authored-by: Andrew Klychkov <andrew.klychkov@gmail.com>
Diffstat (limited to 'test/integration/targets')
-rw-r--r-- | test/integration/targets/postgresql/tasks/postgresql_query.yml | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/integration/targets/postgresql/tasks/postgresql_query.yml b/test/integration/targets/postgresql/tasks/postgresql_query.yml index aca07442e2..4b7642ee92 100644 --- a/test/integration/targets/postgresql/tasks/postgresql_query.yml +++ b/test/integration/targets/postgresql/tasks/postgresql_query.yml @@ -468,3 +468,34 @@ name: test_array_table state: absent when: postgres_version_resp.stdout is version('9.4', '>=') + +############################################################################# +# Issue https://github.com/ansible-collections/community.postgresql/issues/45 +- name: Create table containing a decimal value + become_user: '{{ pg_user }}' + become: true + postgresql_query: + login_user: '{{ pg_user }}' + db: postgres + query: CREATE TABLE blabla (id int, num decimal) + +- name: Insert data + become_user: '{{ pg_user }}' + become: true + postgresql_query: + login_user: '{{ pg_user }}' + db: postgres + query: INSERT INTO blabla (id, num) VALUES (1, 1::decimal) + +- name: Get data + become_user: '{{ pg_user }}' + become: true + postgresql_query: + login_user: '{{ pg_user }}' + db: postgres + query: SELECT * FROM blabla + register: result + +- assert: + that: + - result.rowcount == 1 |