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

Update country.postgresql.sql #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cangcool
Copy link

When I imported this file on pgAdmin III, I've got error on line 185, because of "'". Maybe its better to remove it
After removed it, I imported it successfully.
Many thanks

When I imported this file on pgAdmin III, I've got error on line 185, because of "\'". Maybe its better to remove it
After removed it, I imported it successfully. 
Many thanks
@rostenkowski
Copy link

You have changed the name of the country!
And what more, you have done it only in PostgreSQL format!

The correct solution is to escape that apostrophe using proper method. Escaping character \
is wrong becuase in PostgreSQL it is done trough the double apostrophe '' as explained eg. here: http://stackoverflow.com/a/12320729

@umpirsky
Copy link
Owner

You changed the data, and you changed it only for en language.

I guess it should be escaped here and then rebuilt.

@jlbooker
Copy link

I've just run across this bug as well. The current SQL does not run to completion because of the quotation issue with 'People\'s Democratic Republic of Yemen'. It should be 'People''s Democratic Republic of Yemen' (notice the two single quotes), as per http://www.postgresql.org/docs/8.2/static/sql-syntax-lexical.html (section 4.1.2.1).

It seems that adding these quotes is the responsiblity of the Zend framework you're using, specifically the Platform object in the call:
->getSqlString($this->getPlatform()). The Platform object is supposed to supply the platform-dependent quoting style. The Zend framework seems to be using an old style (') which newer version of Postgresql don't support. The offending line seems to be here:

https://github.com/zendframework/zf2/blob/master/library/Zend/Db/Adapter/Platform/Postgresql.php#L101

@umpirsky
Copy link
Owner

@jlbooker Thanks for your input. Then we should report it to zf https://github.com/zendframework/zf2/issues/new.

@jlbooker
Copy link

@umpirsky Yes, definitely sounds like it should be reported to ZendFramework. I don't have the Zend Framework installed anywhere though, so I can't rebuild, test, nor reproduce the problem with the latest version of ZF. I'll leave it for you to report if you'd like.

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

Successfully merging this pull request may close these issues.

None yet

5 participants