RE: [julia-users] Can't add PostgreSQL
For the PostgreSQL package, when I do fetchdf against the result of execute, instead of the stmt, it does work. Another problem solved! The DataFrame returned by fetchdf seems to have lost the type information. Am I understanding that right? It seems like undesirable behavior. --- 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") result = execute(stmt) obs = fetchdf(result) produces julia> eltypes(obs) 8-element Array{Type{T},1}: Any Any Any Any Any Any Any Any Ross From: julia-users@googlegroups.com [julia-users@googlegroups.com] on behalf of Cameron McBride [cameron.mcbr...@gmail.com] Sent: Wednesday, May 04, 2016 3:17 AM To: julia-users Subject: Re: [julia-users] Can't add PostgreSQL I've been using PostgreSQL and DBI just fine for a few months now. The implementation has a few edges that need polishing and work, but the basics work just fine for the julia 0.4.x branch. The problem you ran into with fetchdf() not being implemented is that you tried to run it on the stmt (before running execute). This is one of the rough edges that not all convenience functions are implemented. In short, I just confirmed the following example runs on julia 0.4.5 and the latest DBI.jl / PostgreSQL.jl: # slightly modified example from https://github.com/JuliaDB/PostgreSQL.jl using DBI using PostgreSQL conn = connect(Postgres, "localhost", "username", "password", "dbname", 5432) stmt = prepare(conn, "SELECT 1::bigint, 2.0::double precision, 'foo'::character varying, " * "'foo'::character(10);") result = execute(stmt) # this was missing in your use! df = fetchdf(result) finish(stmt) disconnect(conn) Perhaps that helps clarify? Happy to help further, here or offline. Cameron
RE: [julia-users] Can't add PostgreSQL
ODBC is now working for me with the documented interface (after updates). Thanks! I do get a lot of chatter as it loads, mostly from the DecFP package. The documentation doesn't mention how to shutdown. I used disconnect!(dsn) after peeking at the code. Does it clean up the connection if you just exit the julia session without disconnect? Also, in this sequence 1. datatable = ODBC.query(dsn, "show databases") # convert result to a DataFrame for additional data manipulation functionality 2. df = DataFrame(datatable) 3. do stuff with df at what point is it safe to disconnect? Is the odbc interface in general, or particularly with postgresql, thread safe? On a more general topic I got lots of notices my packages were out of date, even immediately after I installed them. What's that about? E.g., julia> Pkg.add("Cairo") INFO: Nothing to be done INFO: METADATA is out-of-date — you may not have the latest version of Cairo INFO: Use 'Pkg.update()' to get the latest versions of your packages julia> Pkg.update() INFO: Updating METADATA... INFO: Updating DBI... INFO: Updating PostgreSQL... INFO: Updating Postgres... INFO: Computing changes... INFO: No packages to install, update or remove Ross From: karbar...@gmail.com [karbar...@gmail.com] on behalf of Jacob Quinn [quinn.jac...@gmail.com] Sent: Wednesday, May 04, 2016 7:47 AM To: julia-users@googlegroups.com Subject: Re: [julia-users] Can't add PostgreSQL Hey Ross, It actually sounds like you're still on the older release of ODBC (you can check by running Pkg.installed()). To get the latest version (that matches the current documentation), you'll have to run: Pkg.update() Then restart Julia to make sure you have the latest code. -Jacob On Tue, May 3, 2016 at 9:58 PM, Boylan, Ross <ross.boy...@ucsf.edu> wrote: I got it working before your update. Yay! Thank you! There were a couple of issues, mostly documentation, leaving aside getting ODBC setup outside of julia. The docs (the help at https://github.com/JuliaDB/ODBC.jl) say to use DSN to get things going. As far as I can tell, it doesn't exist. I used connect. The docs mention a connection string, but provide no pointers to its content. It would be nice to have one; the odbc packages I installed were almost documentation free. The docs imply the results of a query need to be turned into a DataFrame, but it seems to come out as one. The source code suggested one could get a dataframe with the output argument. I'm not really sure what that's supposed to be or do, but when I tried julia> raw = ODBC.query("SELECT isim, id, x, t, y, regular, censor, wait from obs2619 where isim=1", conn, output=df ) ERROR: TypeError: typeassert: expected Union{AbstractString,DataType}, got Function I had not set df to anything before the call, AFAIK. Ross From: karbar...@gmail.com [karbar...@gmail.com] on behalf of Jacob Quinn [quinn.jac...@gmail.com] Sent: Tuesday, May 03, 2016 7:57 PM To: julia-users@googlegroups.com Subject: Re: [julia-users] Can't add PostgreSQL Hey Ross, Just confirmed that connecting to Postgres does indeed work; haven't seen any issues yet. I'm using the PostgreSQL ODBC Driver from their website with unixODBC on a mac. I'm using a connection string I built by following the guidelines here: http://www.connectionstrings.com/postgresql-odbc-driver-psqlodbc/ Here's a little sample code (I have more testing all the various data types in Postgres, but I won't post the full snippet here): using ODBC dsn = ODBC.DSN("Driver={PostgreSQL};Server=[server];Port=5432;Database=testdb;Uid=username;Pwd=password") # Check some basic queries dbs = ODBC.query(dsn, "SELECT datname FROM pg_database WHERE datistemplate = false;") data = ODBC.query(dsn, "SELECT table_schema,table_name FROM information_schema.tables ORDER BY table_schema,table_name;") The latest ODBC release was just merged in METADATA.jl, so if you do Pkg.add("ODBC") you should get the latest release/code. If you already had it installed, just run Pkg.update() to get the latest release. Good luck! -Jacob On Tue, May 3, 2016 at 7:11 PM, Boylan, Ross <ross.boy...@ucsf.edu> wrote: Attempting to post comments inline, even though my mailer is allergic. Look for >> From: karbar...@gmail.com [karbar...@gmail.com] on behalf of Jacob Quinn [quinn.jac...@gmail.com] Sent: Tuesday, May 03, 2016 5:47 PM I'm not sure I understand: I don't see DBI.jl nor PostgreSQL.jl at pkg.julialang.org, which tells me they aren't officially registered as packages. The difficulties you're seeing then aren't that surprising because they haven't felt comfortable enough to officially register. >> Yo
Re: [julia-users] Can't add PostgreSQL
Hey Ross, It actually sounds like you're still on the older release of ODBC (you can check by running Pkg.installed()). To get the latest version (that matches the current documentation), you'll have to run: Pkg.update() Then restart Julia to make sure you have the latest code. -Jacob On Tue, May 3, 2016 at 9:58 PM, Boylan, Ross <ross.boy...@ucsf.edu> wrote: > I got it working before your update. Yay! Thank you! > > There were a couple of issues, mostly documentation, leaving aside getting > ODBC setup outside of julia. > > The docs (the help at https://github.com/JuliaDB/ODBC.jl) say to use DSN > to get things going. As far as I can tell, it doesn't exist. I used > connect. > > The docs mention a connection string, but provide no pointers to its > content. It would be nice to have one; the odbc packages I installed were > almost documentation free. > > The docs imply the results of a query need to be turned into a DataFrame, > but it seems to come out as one. > > The source code suggested one could get a dataframe with the output > argument. I'm not really sure what that's supposed to be or do, but when I > tried > julia> raw = ODBC.query("SELECT isim, id, x, t, y, regular, censor, wait > from obs2619 where isim=1", conn, output=df > ) > > ERROR: TypeError: typeassert: expected Union{AbstractString,DataType}, > got Function > I had not set df to anything before the call, AFAIK. > > Ross > -- > *From:* karbar...@gmail.com [karbar...@gmail.com] on behalf of Jacob > Quinn [quinn.jac...@gmail.com] > *Sent:* Tuesday, May 03, 2016 7:57 PM > *To:* julia-users@googlegroups.com > *Subject:* Re: [julia-users] Can't add PostgreSQL > > Hey Ross, > > Just confirmed that connecting to Postgres does indeed work; haven't seen > any issues yet. I'm using the PostgreSQL ODBC Driver from their website > with unixODBC on a mac. I'm using a connection string I built by following > the guidelines here: > http://www.connectionstrings.com/postgresql-odbc-driver-psqlodbc/ > > Here's a little sample code (I have more testing all the various data > types in Postgres, but I won't post the full snippet here): > > using ODBC > > dsn = > ODBC.DSN("Driver={PostgreSQL};Server=[server];Port=5432;Database=testdb;Uid=username;Pwd=password") > > # Check some basic queries > dbs = ODBC.query(dsn, "SELECT datname FROM pg_database WHERE datistemplate > = false;") > data = ODBC.query(dsn, "SELECT table_schema,table_name FROM > information_schema.tables ORDER BY table_schema,table_name;") > > > The latest ODBC release was just merged in METADATA.jl, so if you do > Pkg.add("ODBC") you should get the latest release/code. If you already had > it installed, just run Pkg.update() to get the latest release. > > Good luck! > > -Jacob > > On Tue, May 3, 2016 at 7:11 PM, Boylan, Ross <ross.boy...@ucsf.edu> wrote: > >> Attempting to post comments inline, even though my mailer is allergic. >> Look for >> >> >> >> From: karbar...@gmail.com [karbar...@gmail.com] on behalf of Jacob Quinn >> [quinn.jac...@gmail.com] >> Sent: Tuesday, May 03, 2016 5:47 PM >> >> I'm not sure I understand: I don't see DBI.jl nor PostgreSQL.jl at >> pkg.julialang.org, which tells me they aren't officially registered as >> packages. The difficulties you're seeing then aren't that surprising >> because they haven't felt comfortable enough to officially register. >> >> >> You're right. I got to them through https://github.com/JuliaDB >> >> ODBC actually works fine on Linux/OSX through the unixODBC library. It >> can be installed through a variety of means, but works quite well from what >> I've seen. Postgres is actually next on my list to test with ODBC (so far >> the testing has focused >> on Teradata, SQL Server, and MySQL), so if I find time in the next few >> days, I'll try to put together an example and share it here. >> >> The status page indicates errors with julia 0.4 and Linux. Does it >> matter? Clicking on the build logs it appears the most recent build for >> 0.4, 124.4 (https://travis-ci.org/JuliaDB/ODBC.jl) succeeded, so I'm not >> sure why the problem is showing (also the previous error looks like a >> problem with the configuration of the build machine rather than a problem >> with the package). >> >> >> No joy with the alternate Postgresl package; >> https://github.com/NCarson/Postgres.jl/issues/3 has the details. >> >> >> So I guess I'll give ODBC a whirl. Thanks for your help. >> > >
Re: [julia-users] Can't add PostgreSQL
I've been using PostgreSQL and DBI just fine for a few months now. The implementation has a few edges that need polishing and work, but the basics work just fine for the julia 0.4.x branch. The problem you ran into with fetchdf() not being implemented is that you tried to run it on the stmt (before running execute). This is one of the rough edges that not all convenience functions are implemented. In short, I just confirmed the following example runs on julia 0.4.5 and the latest DBI.jl / PostgreSQL.jl: # slightly modified example from https://github.com/JuliaDB/PostgreSQL.jl using DBIusing PostgreSQL conn = connect(Postgres, "localhost", "username", "password", "dbname", 5432) stmt = prepare(conn, "SELECT 1::bigint, 2.0::double precision, 'foo'::character varying, " * "'foo'::character(10);") result = execute(stmt) # this was missing in your use! df = fetchdf(result)finish(stmt) disconnect(conn) Perhaps that helps clarify? Happy to help further, here or offline. Cameron
RE: [julia-users] Can't add PostgreSQL
I got it working before your update. Yay! Thank you! There were a couple of issues, mostly documentation, leaving aside getting ODBC setup outside of julia. The docs (the help at https://github.com/JuliaDB/ODBC.jl) say to use DSN to get things going. As far as I can tell, it doesn't exist. I used connect. The docs mention a connection string, but provide no pointers to its content. It would be nice to have one; the odbc packages I installed were almost documentation free. The docs imply the results of a query need to be turned into a DataFrame, but it seems to come out as one. The source code suggested one could get a dataframe with the output argument. I'm not really sure what that's supposed to be or do, but when I tried julia> raw = ODBC.query("SELECT isim, id, x, t, y, regular, censor, wait from obs2619 where isim=1", conn, output=df ) ERROR: TypeError: typeassert: expected Union{AbstractString,DataType}, got Function I had not set df to anything before the call, AFAIK. Ross From: karbar...@gmail.com [karbar...@gmail.com] on behalf of Jacob Quinn [quinn.jac...@gmail.com] Sent: Tuesday, May 03, 2016 7:57 PM To: julia-users@googlegroups.com Subject: Re: [julia-users] Can't add PostgreSQL Hey Ross, Just confirmed that connecting to Postgres does indeed work; haven't seen any issues yet. I'm using the PostgreSQL ODBC Driver from their website with unixODBC on a mac. I'm using a connection string I built by following the guidelines here: http://www.connectionstrings.com/postgresql-odbc-driver-psqlodbc/ Here's a little sample code (I have more testing all the various data types in Postgres, but I won't post the full snippet here): using ODBC dsn = ODBC.DSN("Driver={PostgreSQL};Server=[server];Port=5432;Database=testdb;Uid=username;Pwd=password") # Check some basic queries dbs = ODBC.query(dsn, "SELECT datname FROM pg_database WHERE datistemplate = false;") data = ODBC.query(dsn, "SELECT table_schema,table_name FROM information_schema.tables ORDER BY table_schema,table_name;") The latest ODBC release was just merged in METADATA.jl, so if you do Pkg.add("ODBC") you should get the latest release/code. If you already had it installed, just run Pkg.update() to get the latest release. Good luck! -Jacob On Tue, May 3, 2016 at 7:11 PM, Boylan, Ross <ross.boy...@ucsf.edu<mailto:ross.boy...@ucsf.edu>> wrote: Attempting to post comments inline, even though my mailer is allergic. Look for >> From: karbar...@gmail.com<mailto:karbar...@gmail.com> [karbar...@gmail.com<mailto:karbar...@gmail.com>] on behalf of Jacob Quinn [quinn.jac...@gmail.com<mailto:quinn.jac...@gmail.com>] Sent: Tuesday, May 03, 2016 5:47 PM I'm not sure I understand: I don't see DBI.jl nor PostgreSQL.jl at pkg.julialang.org<http://pkg.julialang.org>, which tells me they aren't officially registered as packages. The difficulties you're seeing then aren't that surprising because they haven't felt comfortable enough to officially register. >> You're right. I got to them through https://github.com/JuliaDB ODBC actually works fine on Linux/OSX through the unixODBC library. It can be installed through a variety of means, but works quite well from what I've seen. Postgres is actually next on my list to test with ODBC (so far the testing has focused on Teradata, SQL Server, and MySQL), so if I find time in the next few days, I'll try to put together an example and share it here. >> The status page indicates errors with julia 0.4 and Linux. Does it matter? >> Clicking on the build logs it appears the most recent build for 0.4, 124.4 >> (https://travis-ci.org/JuliaDB/ODBC.jl) succeeded, so I'm not sure why the >> problem is showing (also the previous error looks like a problem with the >> configuration of the build machine rather than a problem with the package). >> No joy with the alternate Postgresl package; >> https://github.com/NCarson/Postgres.jl/issues/3 has the details. >> So I guess I'll give ODBC a whirl. Thanks for your help.
Re: [julia-users] Can't add PostgreSQL
Hey Ross, Just confirmed that connecting to Postgres does indeed work; haven't seen any issues yet. I'm using the PostgreSQL ODBC Driver from their website with unixODBC on a mac. I'm using a connection string I built by following the guidelines here: http://www.connectionstrings.com/postgresql-odbc-driver-psqlodbc/ Here's a little sample code (I have more testing all the various data types in Postgres, but I won't post the full snippet here): using ODBC dsn = ODBC.DSN("Driver={PostgreSQL};Server=[server];Port=5432;Database=testdb;Uid=username;Pwd=password") # Check some basic queries dbs = ODBC.query(dsn, "SELECT datname FROM pg_database WHERE datistemplate = false;") data = ODBC.query(dsn, "SELECT table_schema,table_name FROM information_schema.tables ORDER BY table_schema,table_name;") The latest ODBC release was just merged in METADATA.jl, so if you do Pkg.add("ODBC") you should get the latest release/code. If you already had it installed, just run Pkg.update() to get the latest release. Good luck! -Jacob On Tue, May 3, 2016 at 7:11 PM, Boylan, Rosswrote: > Attempting to post comments inline, even though my mailer is allergic. > Look for >> > > > From: karbar...@gmail.com [karbar...@gmail.com] on behalf of Jacob Quinn [ > quinn.jac...@gmail.com] > Sent: Tuesday, May 03, 2016 5:47 PM > > I'm not sure I understand: I don't see DBI.jl nor PostgreSQL.jl at > pkg.julialang.org, which tells me they aren't officially registered as > packages. The difficulties you're seeing then aren't that surprising > because they haven't felt comfortable enough to officially register. > > >> You're right. I got to them through https://github.com/JuliaDB > > ODBC actually works fine on Linux/OSX through the unixODBC library. It can > be installed through a variety of means, but works quite well from what > I've seen. Postgres is actually next on my list to test with ODBC (so far > the testing has focused > on Teradata, SQL Server, and MySQL), so if I find time in the next few > days, I'll try to put together an example and share it here. > >> The status page indicates errors with julia 0.4 and Linux. Does it > matter? Clicking on the build logs it appears the most recent build for > 0.4, 124.4 (https://travis-ci.org/JuliaDB/ODBC.jl) succeeded, so I'm not > sure why the problem is showing (also the previous error looks like a > problem with the configuration of the build machine rather than a problem > with the package). > > >> No joy with the alternate Postgresl package; > https://github.com/NCarson/Postgres.jl/issues/3 has the details. > > >> So I guess I'll give ODBC a whirl. Thanks for your help. >
RE: [julia-users] Can't add PostgreSQL
Attempting to post comments inline, even though my mailer is allergic. Look for >> From: karbar...@gmail.com [karbar...@gmail.com] on behalf of Jacob Quinn [quinn.jac...@gmail.com] Sent: Tuesday, May 03, 2016 5:47 PM I'm not sure I understand: I don't see DBI.jl nor PostgreSQL.jl at pkg.julialang.org, which tells me they aren't officially registered as packages. The difficulties you're seeing then aren't that surprising because they haven't felt comfortable enough to officially register. >> You're right. I got to them through https://github.com/JuliaDB ODBC actually works fine on Linux/OSX through the unixODBC library. It can be installed through a variety of means, but works quite well from what I've seen. Postgres is actually next on my list to test with ODBC (so far the testing has focused on Teradata, SQL Server, and MySQL), so if I find time in the next few days, I'll try to put together an example and share it here. >> The status page indicates errors with julia 0.4 and Linux. Does it matter? >> Clicking on the build logs it appears the most recent build for 0.4, 124.4 >> (https://travis-ci.org/JuliaDB/ODBC.jl) succeeded, so I'm not sure why the >> problem is showing (also the previous error looks like a problem with the >> configuration of the build machine rather than a problem with the package). >> No joy with the alternate Postgresl package; >> https://github.com/NCarson/Postgres.jl/issues/3 has the details. >> So I guess I'll give ODBC a whirl. Thanks for your help.
RE: [julia-users] Can't add PostgreSQL
I'm not sure I understand: I don't see DBI.jl nor PostgreSQL.jl at pkg.julialang.org, which tells me they aren't officially registered as packages. The difficulties you're seeing then aren't that surprising because they haven't felt comfortable enough to officially register. ODBC actually works fine on Linux/OSX through the unixODBC library. It can be installed through a variety of means, but works quite well from what I've seen. Postgres is actually next on my list to test with ODBC (so far the testing has focused on Teradata, SQL Server, and MySQL), so if I find time in the next few days, I'll try to put together an example and share it here. -Jacob On May 3, 2016 5:16 PM, "Boylan, Ross" <ross.boy...@ucsf.edu> wrote: > 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:* julia-users@googlegroups.com > *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:* karbar...@gmail.com [karbar...@gmail.com] on behalf of Jacob > Quinn [quinn.jac...@gmail.com] > *Sent:* Tuesday, May 03, 2016 3:23 PM > *To:* julia-users@googlegroups.com > *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 <ross.boy...@ucsf.edu> 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. > > >
RE: [julia-users] Can't add PostgreSQL
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: julia-users@googlegroups.com 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: karbar...@gmail.com [karbar...@gmail.com] on behalf of Jacob Quinn [quinn.jac...@gmail.com] Sent: Tuesday, May 03, 2016 3:23 PM To: julia-users@googlegroups.com 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 <ross.boy...@ucsf.edu<mailto:ross.boy...@ucsf.edu>> 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.
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: karbar...@gmail.com [karbar...@gmail.com] on behalf of Jacob Quinn [quinn.jac...@gmail.com] Sent: Tuesday, May 03, 2016 3:23 PM To: julia-users@googlegroups.com 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 <ross.boy...@ucsf.edu<mailto:ross.boy...@ucsf.edu>> 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.
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, Rosswrote: > 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.