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

added pg_config support; factored CFLAGS and LIBS as separate steps. #81

Merged
merged 2 commits into from
Dec 28, 2016
Merged

added pg_config support; factored CFLAGS and LIBS as separate steps. #81

merged 2 commits into from
Dec 28, 2016

Conversation

mmuurr
Copy link
Contributor

@mmuurr mmuurr commented Feb 24, 2016

The PostgreSQL installations on Amazon Linux have a variety of annoying issues.

  1. They don't play nicely with pkg-config, specifically libpq doesn't have any useful .pc entries.
  2. The installation location is non-standard.

But (fortunately!), pg_config does work just fine... so, the proposed changes in this pull request are:

  1. Factor the PKG_CFLAGS and PKG_LIBS into two separate steps (i.e. set the values for each one separately, and check for the cascading conditions below separately for each).
  2. Cascade priority as follows (from highest in the list to lowest):
  • INCLUDEDIR or LIBDIR found on the command line; then
  • values retrieved from pkg-config, if available; then
  • values retrieved from pg_config.

This solves the problem of screwed-up pkg-config entries more generally for Linux distributions outside just Amazon Linux.
And for Amazon Linux in particular, this solves the annoying installation issues.
(I've also included a separate message for Amazon Linux users since there is no generic postgresql-devel package... instead you must specify the version, e.g. postgresql94-devel.)

I'm open to suggestions for other ways to make pkg-config and pg_config play nicely together in the case where both might be installed on a single system, but the pkg-config entries be erroneous or missing (as is the case for most Amazon Linux users).

Closes #22.

@krlmlr
Copy link
Member

krlmlr commented Feb 29, 2016

Thanks, this looks good so far. I'd like to wait for feedback from other affected users before merging this.

@cilindrox
Copy link

cilindrox commented Oct 6, 2016

Getting the following error when testing this

Loading required package: methods
Error in .valueClassTest(ans, "character", "dbListTables") :
  invalid value from generic function 'dbListTables', class "NULL", expected "
character"
Calls: db_list_tables ... db_list_tables.DBIConnection -> dbListTables -> .valueClassTest
In addition: Warning message:
In value[[3L]](cond) : could not find function "columnToRownames"
Execution halted

Which made me think of #88

Update: got this fixed by rebasing this PR on top of master

@krlmlr krlmlr merged commit 3f8dcf7 into r-dbi:master Dec 28, 2016
@krlmlr
Copy link
Member

krlmlr commented Dec 28, 2016

Thanks!

krlmlr added a commit that referenced this pull request Dec 29, 2016
- Added `pg_config` support, factored `CFLAGS` and `LIBS` as separate steps (#81, @mmuurr).
- Fix roundtrip of `logical` values (#108, @thrasibule).
- Fix documentation warning (#109, @thrasibule).
@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.

RPostgres appears to require Homebrew installation on OS X
3 participants