mypebble/django-pgviews

Error with multiple field indexing

Closed this issue · 14 comments

 File "../lib/python3.6/site-packages/django_pgviews/view.py", line 116, in create_view
    cursor.execute('CREATE UNIQUE INDEX {0}_{1}_index ON {0} ({1})'.format(view_name, index))
psycopg2.ProgrammingError: syntax error at or near ","
LINE 1: CREATE UNIQUE INDEX event_view_id, title, external...

I believe the error is because the format string is not expecting index variable to contain multiple columns. {1} present in line 116 will convert a list of index fields into a string.

Seems like this is fixed in master: https://github.com/mypebble/django-pgviews/blob/master/django_pgviews/view.py#L115

Is this fix part of version 0.5.3?

Thanks for looking into this @kochhar. I believe it should be. If not, perhaps @tpict can roll a new release to PyPI.

Thanks for the update @scott-w, I installed 0.5.3 and the index creation uses the index arg that is passed into create_view directly unlike the code in master which first splits on ,

Hi @scott-w, any news on this?

I cannot use pypi's version until a new one is published.

Hi @martinsileno, I no longer work for Pebble, so I don’t have write access to the PyPI for this repo. I’ll ping @tpict again to see if he’s able to push this build up.

tpict commented

hi guys, sorry about the delay - I will look into publishing 0.5.3 in the coming days. I'll also see if there's anything we can do about permissions on the PyPI project.

tpict commented

OK, it looks like 0.5.3 on PyPI is the same as 0.5.2. Not sure what happened there, so I'll bump to 0.5.4 and push that up with the latest commit.

tpict commented

just to keep you all updated, somehow our PyPI login email has dropped back to "unverified" status, and the verification links we're getting sent don't seem to be doing anything, which means that I can't push 0.5.4. I'll let you know if anything changes

Is the PyPI login still an issue for you, @tpict? I was going to see if I could round up some PyPI folks to see if we can't get this solved so the latest version can be released.

tpict commented

@kmctown I finally managed to get back into the account last month! I don't know what changed in the past few months. I completely forgot to actually publish the package though, so I'll do that now

@kmctown I finally managed to get back into the account last month! I don't know what changed in the past few months. I completely forgot to actually publish the package though, so I'll do that now

Oh, awesome! Thanks!

tpict commented

OK, done. I'll wait to hear back from you before closing the issue

All is looking good on our end. Bumped to 0.5.4 and composite concurrent_index now appears to be working as advertised 👏