Skip to content
Advertisement

Tag: postgresql

Problem with COPY FROM with PHP in postgresql

I have some big .csv files and I am trying to put it into database. I am using this construction: But after use i function in CLI I got that: This is not a problem with end marker, but with encoding. If I open this file in VIM and will save it again, everything is OK, but without this operations

Convert PostgreSQL array to PHP array

I have trouble reading Postgresql arrays in PHP. I have tried explode(), but this breaks arrays containing commas in strings, and str_getcsv() but it’s also no good as PostgreSQL doesn’t quote the Japanese strings. Not working: Example: Answer If you have PostgreSQL 9.2 you can do something like this: The result will return the array as JSON Then on the

Advertisement