That's odd. After cloning the Postgres package, and then executing the script from the command line, it gets further: $ julia trouble.jl ERROR: LoadError: DBI API not fully implemented in fetchdf at /home/ross/.julia/v0.4/DBI/src/DBI.jl:97 in include at ./boot.jl:261 in include_from_node1 at ./loading.jl:320 in process_options at ./client.jl:280 in _start at ./client.jl:378 while loading /home/ross/PCORI/trouble.jl, in expression starting on line 6
Here are the 3 additional lines: stmt = prepare(conn, "SELECT isim::int, id::int, x::int, t::double precision, y::int, regular::int, censor::int, wait::double precision from obs2619 where isim=1") execute(stmt) obs = fetchdf(stmt) So the fetchdf fails because it's not implemented. ________________________________ From: Boylan, Ross Sent: Tuesday, May 03, 2016 4:06 PM To: [email protected] Subject: RE: [julia-users] Can't add PostgreSQL Thank you, Jacob, for the pointer. I'm further along but still not there. I did the clone and then build. I'm not sure if the build was necessary, but it took awhile. This process did not install DBI although it's listed as a requirement, and the installer gave no warning about it. When that didn't work I cloned DBI. I'm surprised that packages shown on http://pkg.julialang.org/ are not necessarily in https://github.com/JuliaLang/METADATA.jl. Neither DBI nor PostgreSQL are there. Does it mean anything if a package is not in METADATA? After all that I got julia> Pkg.clone("https://github.com/JuliaDB/DBI.jl.git") INFO: Cloning DBI from https://github.com/JuliaDB/DBI.jl.git INFO: Computing changes... !julia> include("/home/ross/PCORI/trouble.jl") INFO: Precompiling module DataArrays... INFO: Precompiling module DataFrames... ERROR: LoadError: UndefVarError: Postgres not defined in include at ./boot.jl:261 in include_from_node1 at ./loading.jl:320 while loading /home/ross/PCORI/trouble.jl, in expression starting on line 3 trouble.jl begins using DBI using PostgreSQL conn = connect(Postgres, "localhost", "user", "word", "table") Ideas? Isn't ODBC just for MS Windows? There's also https://github.com/NCarson/Postgres.jl; an announcement said it didn't implement the full DBI spec. Ross ________________________________ From: [email protected] [[email protected]] on behalf of Jacob Quinn [[email protected]] Sent: Tuesday, May 03, 2016 3:23 PM To: [email protected] Subject: Re: [julia-users] Can't add PostgreSQL I don't think the PostgreSQL.jl package was ever officially registered. You could try Pkg.clone("https://github.com/JuliaDB/PostgreSQL.jl") to manually download/install it; you may need to do Pkg.build("PostgreSQL") as well after cloning. Alternatively, you might try the latest master of https://github.com/JuliaDB/ODBC.jl for interacting with databases. -Jacob On Tue, May 3, 2016 at 4:19 PM, Boylan, Ross <[email protected]<mailto:[email protected]>> wrote: Am I misunderstanding how things work? Is the package only available for julia 0.3? I have a julia obtained via git a few days ago, on the release-0.4 branch and built locally. Seeing https://github.com/JuliaDB/PostgreSQL.jl I tried, from within an ESS session, julia> Pkg.add("PostgreSQL") ERROR: unknown package PostgreSQL in error at ./error.jl:21 [inlined code] from pkg/entry.jl:49 in anonymous at task.jl:447 in sync_end at ./task.jl:413 [inlined code] from task.jl:422 in add at pkg/entry.jl:64 in add at pkg/entry.jl:73 in anonymous at pkg/dir.jl:31 in cd at file.jl:22 in cd at pkg/dir.jl:31 in add at pkg.jl:23 To see if this was a spelling mistake: julia> Pkg.add("PostgresSQL") ERROR: unknown package PostgresSQL ... I was able to add the DataFrames package and dependencies. This is on a current Debian system, amd64 architecture.
