JuliaDatabases / PostgreSQL.jl

DEPRECATED: use LibPQ.jl instead
https://github.com/invenia/LibPQ.jl
Other
60 stars 39 forks source link

Added handling of date types #12

Closed cuevasclemente closed 9 years ago

cuevasclemente commented 9 years ago

Currently, when trying to pull a table in with a column that contains postgres date types, (PG Type 1082) the following error will be raised by DBI.execute:

`convert` has no method matching convert(::Type{PostgresType{Name}}, ::Type{OID{1082}})
while loading In[7], in expression starting on line 1

 in convert at base.jl:13
 in PostgresResultHandle at /Users/user/.julia/v0.3/PostgreSQL/src/types.jl:156
 in execute at /Users/user/.julia/v0.3/PostgreSQL/src/dbi_impl.jl:165
 in anonymous at In[6]:9 # This was done in an iJulia notebook
 in connect at /Users/user/.julia/v0.3/DBI/src/DBI.jl:56
 in get_postgres_table at In[6]:2

These changes were made to address this, while I have not written tests in the style of the test suite to accommodate these, they did solve this error and allow me to use execute and DBI.fetchdf to get a dataframe of the table that failed with this error before. A good idea may be to write tests in the style of the test suite for these changes, but I do not have the time nor the wherewithal to do so, but I do know that currently the library throws errors on tables with date columns.