arcapos / luapgsql

Lua binding for PostgreSQL
108 stars 24 forks source link

PQputCopyEnd errormsg argument #41

Closed daurnimator closed 8 years ago

daurnimator commented 8 years ago

int PQputCopyEnd(PGconn *conn, const char *errormsg); Ends the COPY_IN operation successfully if errormsg is NULL. If errormsg is not NULL then the COPY is forced to fail, with the string pointed to by errormsg used as the error message. (One should not assume that this exact error message will come back from the server, however, as the server might have already failed the COPY for its own reasons. Also note that the option to force failure does not work when using pre-3.0-protocol connections.)

To fail a copy you need to be able to pass an errormsg

mbalmer commented 8 years ago

This is now fixed in -head. Thanks.