Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArrayFields not supported #131

Open
Augustinio opened this issue Apr 30, 2021 · 1 comment
Open

ArrayFields not supported #131

Augustinio opened this issue Apr 30, 2021 · 1 comment

Comments

@Augustinio
Copy link

Augustinio commented Apr 30, 2021

Hello,

When trying to export a queryset to csv, I was faced with this error:

  File "/Users/augustinlegalle/.local/share/virtualenvs/medsmart-back-5TZiyDun/lib/python3.7/site-packages/postgres_copy/managers.py", line 220, in to_csv
    data = compiler.execute_sql(csv_path)
  File "/Users/augustinlegalle/.local/share/virtualenvs/medsmart-back-5TZiyDun/lib/python3.7/site-packages/postgres_copy/copy_to.py", line 76, in execute_sql
    c.cursor.copy_expert(copy_to_sql, stdout)
psycopg2.errors.UndefinedFunction: operator does not exist: character varying[] = text[]
LINE 1: ..."practitioners_referencepractitioner"."specialty" IN (ARRAY[...
                                                             ^
HINT:  No operator matches the given name and argument types. You might need to add explicit type casts.

This happened right after having performed a migration that changed the previously CharField specialty field into an ArrayField from django.contrib.postgres.fields.

Are ArrayFields not currently supported?
What are my options?

@palewire
Copy link
Owner

palewire commented May 1, 2021

They are not currently supported, mostly because I never thought of it. Would outputting the contents of the field as a string be your goal?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants