Error message when setting PostgreSQL Database

363 views
Skip to first unread message

Arthur Kor

unread,
Sep 11, 2017, 6:23:42 PM9/11/17
to Django users
Hi Django Community,

I am kind of new to Django web development and I am encountering an error when I am migrating my DB from SQLlite3 to PostgreSQL.
I have installed pgAdmin4, psycopg2 as well as set my DATABASES correctly in settings.py

However, when I run "python migrate.py migrate" command, I receive the following error:
django.db.utils.ProgrammingError: operator class "varchar_pattern_ops" does not accept data type integer

The full error:



I have searched on google for hours and couldn't find anyone how to fix it.

I'd really appreciate if someone could help!

Kind regards
Arthur
Auto Generated Inline Image 1

Lachlan Musicman

unread,
Sep 11, 2017, 6:42:01 PM9/11/17
to django...@googlegroups.com
Can you send us what you have in trading? Also - you have postgres installed, not just pgadmin?

Note that Django on Windows is unusual (not impossible, but definitely unusual) and help may be harder to find

cheers
L.

------
"The antidote to apocalypticism is apocalyptic civics. Apocalyptic civics is the insistence that we cannot ignore the truth, nor should we panic about it. It is a shared consciousness that our institutions have failed and our ecosystem is collapsing, yet we are still here — and we are creative agents who can shape our destinies. Apocalyptic civics is the conviction that the only way out is through, and the only way through is together. "

Greg Bloom @greggish https://twitter.com/greggish/status/873177525903609857

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/7e17bbcb-9c5c-4379-ae0d-b55f97dc4a2e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Melvyn Sopacua

unread,
Sep 13, 2017, 9:51:32 AM9/13/17
to django...@googlegroups.com
One reason you can spend hours searching is because people don't follow up when asked for more information.

However, it's right there on stackoverflow: https://stackoverflow.com/a/43575073/1600649

In general with migrations: when changing types of indexed (primary key, unique) fields, first drop the index. With primary keys and foreign keys, this still gets messy and if the data is live, it's best to come up with a different approach as it's non-trivial to keep the foreign models.


For more options, visit https://groups.google.com/d/optout.



--
Melvyn Sopacua
Reply all
Reply to author
Forward
0 new messages