Skip to content

Update country.postgresql.sql#30

Open
cangcool wants to merge 1 commit into
umpirsky:masterfrom
cangcool:patch-1
Open

Update country.postgresql.sql#30
cangcool wants to merge 1 commit into
umpirsky:masterfrom
cangcool:patch-1

Conversation

@cangcool

Copy link
Copy Markdown

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
@stepansvoboda

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown

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
Copy Markdown
Owner

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

@jlbooker

Copy link
Copy Markdown

@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.

5 participants