Обсуждение: Re: About pyvertica (a clone of pyscopg2)

Поиск
Список
Период
Сортировка

Re: About pyvertica (a clone of pyscopg2)

От
Federico Di Gregorio
Дата:
Hi Angel,

I hope you don't bother I added the psycopg mailing list in cc: other
people can be interested in your work. :)

On 06/09/11 20:22, Angel Freire wrote:
> Hi, my name is Angel and since a few weeks now I've been working with
> some database engine called "Vertica" it's a column-oriented db based
> on PostgreSQL, it's so based on PostgresSQL that with a few little
> modifications pyscopg2 is able to connect to it and perform queries
> without any problems. I've found the patch needed to make pyscopg2 run
> with Vertica in StackOverflow
> (http://stackoverflow.com/questions/2469167/merge-excel-cells-using-pyexcelerator).

I can't find a patch there. :(

> Since I plan to do most of the ETL process in Python having a library
> to accessing the data Warehouse is really a basic tool and having a
> native Python client library that is able to connect to Vertica is
> just great.
>
> Before found that about pyscopg2 and that patch I started coding my
> own DB API 2.0 module, but I've found that will be easy to reutilize
> your work, and so is the question in this email:
>
> It's ok if I do that? I really don't know much about licences, my
> intention is to give all the credit to the real authors (I'm trying to
> found who was the one that posted that on stack overflow).

As long as you respect the LGPL3 (because you distribute source code
keeping all copyright notices is more or less all you need to do) it is
perfectly fine to reutilize psycopg2 code in your work.

> For now I've uploaded the patched source code to github, my plan it's
> to modify it to be called "pyvertica" but have explicit messages about
> how it's a copy of the pyscopg2 source code, leaving the authors
> credits were it belongs: https://github.com/cuerty/pyvertica

I'd like very much to see the changes you're doing. If they are few and
localized it would be great to incorporate them directly into psycopg2
source code, to maintain a single code base.

In any case, if you find bugs or improve something that can be ported
back to PostgreSQL please send an email to psycopg@postgresql.org so
that we can incorporate your fixes and improvements.

> That beign said, I couldn't clone the repo to have the proper history
> (I think that it'll be good to have that, if you please fix the git
> repot it'll be awesome).

What's wrong with:

git clone -b devel git://luna.dndg.it/public/psycopg2

Hope this helps,
federico

--
Federico Di Gregorio                                       fog@initd.org
 But not all bugs are an interesting challenge. Some are just a total
  waste of my time, which usually is much more valuable than the time of
  the submitter.                                                   -- Md


Вложения

Re: About pyvertica (a clone of pyscopg2)

От
Daniele Varrazzo
Дата:
On Wed, Sep 7, 2011 at 10:12 AM, Federico Di Gregorio <fog@initd.org> wrote:
> Hi Angel,
>
> I hope you don't bother I added the psycopg mailing list in cc: other
> people can be interested in your work. :)
>
> On 06/09/11 20:22, Angel Freire wrote:
>> Hi, my name is Angel and since a few weeks now I've been working with
>> some database engine called "Vertica" it's a column-oriented db based
>> on PostgreSQL, it's so based on PostgresSQL that with a few little
>> modifications pyscopg2 is able to connect to it and perform queries
>> without any problems. I've found the patch needed to make pyscopg2 run
>> with Vertica in StackOverflow
>> (http://stackoverflow.com/questions/2469167/merge-excel-cells-using-pyexcelerator).
>
> I can't find a patch there. :(

It may have been this:

http://stackoverflow.com/questions/2695684/using-an-odbc-application-with-a-jdbc-driver

Looks like Vertica has a few differences in the types oid.
Unfortunately there is at least a conflict: from the patch I see oid
16 is used by Vertica as a decimal type, while Postgres uses the same
oid for the bool type. A solution could be to detect vertica at
connection time (which seems done by checking server_version = 0, I
don't know if there is a more robust way) and re-organize the
typecaster map accordingly.

-- Daniele

Re: About pyvertica (a clone of pyscopg2)

От
Federico Di Gregorio
Дата:
On 07/09/11 11:38, Daniele Varrazzo wrote:
[snip]
> It may have been this:
>
> http://stackoverflow.com/questions/2695684/using-an-odbc-application-with-a-jdbc-driver
>
> Looks like Vertica has a few differences in the types oid.
> Unfortunately there is at least a conflict: from the patch I see oid
> 16 is used by Vertica as a decimal type, while Postgres uses the same
> oid for the bool type. A solution could be to detect vertica at
> connection time (which seems done by checking server_version = 0, I
> don't know if there is a more robust way) and re-organize the
> typecaster map accordingly.

If that are the only changes needed we can probably reorganize the type
map into two different maps and attach the correct one at connection
time. Then psycopg would be able to work with Vertica and PostgreSQL at
the same time. Pretty useful to transfer data to and from. :)

federico

--
Federico Di Gregorio                                       fog@initd.org
  Nessuno dice che non si possa sognare in dettaglio, essere realistici
   e magari realizzarlo pure, il sogno.                        -- <dani>


Вложения

Re: About pyvertica (a clone of pyscopg2)

От
Marco Beri
Дата:
On Wednesday, September 7, 2011, Federico Di Gregorio <fog@initd.org> wrote:
> Hi Angel,
>
> I hope you don't bother I added the psycopg mailing list in cc: other
> people can be interested in your work. :)
>
> On 06/09/11 20:22, Angel Freire wrote:
>> Hi, my name is Angel and since a few weeks now I've been working with
>> some database engine called "Vertica" it's a column-oriented db based
>> on PostgreSQL, it's so based on PostgresSQL that with a few little
>> modifications pyscopg2 is able to connect to it and perform queries
>> without any problems. I've found the patch needed to make pyscopg2 run
>> with Vertica in StackOverflow
>> (http://stackoverflow.com/questions/2469167/merge-excel-cells-using-pyexcelerator).
>
> I can't find a patch there. :(

Google is your friend :-)

http://stackoverflow.com/questions/2695684/using-an-odbc-application-with-a-jdbc-driver/2916918#2916918

Ciao.
Marco.


--

Re: About pyvertica (a clone of pyscopg2)

От
Marco Beri
Дата:
On Wednesday, September 7, 2011, Marco Beri <marcoberi@gmail.com> wrote:

> Google is your friend :-)

But gmail on a cell phone attached to a bad wifi spot isn't your friend...

Sorry for the dupe :-)

Ciao.
Marco.


--