Skip to content

Handles NA values by converting them to NULL - #82

Merged
krlmlr merged 1 commit into
r-dbi:masterfrom
thrasibule:insert_NULL
Aug 7, 2017
Merged

krlmlr merged 1 commit into
r-dbi:masterfrom
thrasibule:insert_NULL

Conversation

@thrasibule

Copy link
Copy Markdown
Contributor

This fixes #67.

@thrasibule
thrasibule force-pushed the insert_NULL branch 2 times, most recently from a782e3a to 36b8fdd Compare November 28, 2016 02:33
@thrasibule
thrasibule force-pushed the insert_NULL branch 2 times, most recently from c74c2e1 to a92aa8c Compare December 17, 2016 22:58
Comment thread src/PqResult.h
@@ -93,9 +93,14 @@ class PqResult : boost::noncopyable {
std::vector<int> c_formats(nparams_);
std::vector<std::string> s_params(nparams_);
for (int i = 0; i < nparams_; ++i) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do wonder why only character parameters are supported here. Is this a limitation of PostgreSQL?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything is passed as text to the bindings. So it doesn't matter what the original type of the parameters are, they are always converted to character. We could talk to libpq using the binary protocol but that's another undertaking...

@krlmlr
krlmlr merged commit 02d537f into r-dbi:master Aug 7, 2017
@krlmlr

krlmlr commented Aug 7, 2017

Copy link
Copy Markdown
Member

Thanks!

krlmlr added a commit that referenced this pull request Aug 7, 2017
- Update Rcpp registration code.
- `dbConnect()` now accepts arbitrary connection parameters in the `...` argument (#83, @thrasibule).
- Handles NA values by converting them to NULL (#82, @thrasibule).
- Handle string quoting and missing values in strings (#89, @jimhester).
- `PKG_CFLAGS` and `PKG_LIBS` are now being set when using pg_config for `includedir` and `libdir` (#119, @Usman-R).
- Use `BYTEA` instead of `BLOB` for PostgreSQL 9.5 support.
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Dec 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't bind NA values

2 participants