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

Postgres: Add missing comma to build_sql call used translate paste() #1357

Merged
merged 2 commits into from Aug 27, 2015

Conversation

@rbdixon
Copy link
Contributor

@rbdixon rbdixon commented Aug 27, 2015

con = src_postgres()
data = copy_to(con, tbl_df( data.frame(l=LETTERS)), name = dplyr:::random_table_name() )
print( summarize(data, m=paste(l, collapse="/")))

The code above fails yielding:

Error in postgresqlExecStatement(conn, statement, ...) :
RS-DBI driver: (could not Retrieve the result : ERROR:  type "l" does not exist
LINE 2: FROM (SELECT string_agg("l"'/') AS "m"

Simply missing a comma. With this patch applied you get the expected:

Source: postgres 9.4.4 [gt5392c@localhost:5432/gt5392c]
From: <derived table> [?? x 1]
   m
1  A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z
..                                                 ...
@rbdixon rbdixon changed the title Postgres: Add missing comma to build_sql call used translate collapse() Postgres: Add missing comma to build_sql call used translate paste() Aug 27, 2015
@hadley
Copy link
Member

@hadley hadley commented Aug 27, 2015

Nice. Could you please also add a bullet to NEWS? It should go in the databases section and look like * brief description (@yourusername, #thisissue)

@rbdixon
Copy link
Contributor Author

@rbdixon rbdixon commented Aug 27, 2015

Done.

hadley added a commit that referenced this issue Aug 27, 2015
Postgres: Add missing comma to build_sql call used translate paste()
@hadley hadley merged commit 21d24b4 into tidyverse:master Aug 27, 2015
1 check passed
@hadley
Copy link
Member

@hadley hadley commented Aug 27, 2015

Thanks!

@rbdixon rbdixon deleted the postgres_collapse_fix branch Sep 8, 2015
krlmlr pushed a commit to krlmlr/dplyr that referenced this issue Mar 2, 2016
Postgres: Add missing comma to build_sql call used translate paste()
@lock
Copy link

@lock lock bot commented Jan 19, 2019

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants