Re: [HACKERS] Rust bindings to pgtypes lib

2017-07-07 Thread Andres Freund
On 2017-07-07 12:54:33 +0200, Michael Meskes wrote:
> > Some people use http://libpqtypes.esilo.com/
>
> Never before saw this. It does not seem to have more in common than the
> name, though.

It has binary to text conversion functionality for various types.  I
don't exactly know what Kaare needs, but that seems like a relevant
need.

- Andres


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] Rust bindings to pgtypes lib

2017-07-07 Thread Kaare Rasmussen
I agree with Michael Meskes that duplicating the code is probably not a good 
idea. Now I see other rust crates just depend on the right libraries to be 
installed by the developer, so I'll punt the problem until it bites me for 
real.

This confuses me, though

> Indeed. I'm quite strongly against exposing / using pgtypeslib in more
> places. If anything it should be phased out. Because that code is
> definitely not always kept up2date, and it's a lot of work to do so.  If
> anything the code should be rewritten to *not* require so much
> duplication, then we could talk

Is this a widespread opinion?  If so, perhaps it would be an idea to mention 
that somewhere in the docs. Just reading them, it would seem to be a nice 
interface to a library that can do datetime and arbitrary numeric calculation 
for you. Both areas are very hard to get right.

No problem on my part. The target of my small project was to learn some rust 
by throing myself at it. And I learned more than expected, so the outcome is 
already fine. If the resulting project also could be of use to me and anybody 
else, it would just be an extra win.

-- 
Med venlig hilsen
Kaare Rasmussen, Jasonic

Jasonic:  Nordre Fasanvej 12, 2000 Frederiksberg



-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] Rust bindings to pgtypes lib

2017-07-07 Thread Michael Meskes
> Indeed. I'm quite strongly against exposing / using pgtypeslib in more
> places. If anything it should be phased out. Because that code is

Feel free to come up with a replacement. :)

> definitely not always kept up2date, and it's a lot of work to do so.  If
> anything the code should be rewritten to *not* require so much
> duplication, then we could talk.

Agreed. However, it could be argued that the code is not duplication
(anymore) but a separate implementation of these datatypes.

>> I'm not aware of any other language binding for pgtypeslib.
> 
> Some people use http://libpqtypes.esilo.com/

Never before saw this. It does not seem to have more in common than the
name, though.

Michael
-- 
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Meskes at (Debian|Postgresql) dot Org
Jabber: michael at xmpp dot meskes dot org
VfL Borussia! Força Barça! Go SF 49ers! Use Debian GNU/Linux, PostgreSQL


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] Rust bindings to pgtypes lib

2017-07-06 Thread Andres Freund
Hi,

On 2017-07-06 20:26:29 +0200, Michael Meskes wrote:
> > But is this possible, or feasible? I see that the makefile refers to 
> 
> Possible yes, but in general I'm not a big fan of duplicating code. I
> spend too much time to keep those copies in sync.

Indeed. I'm quite strongly against exposing / using pgtypeslib in more
places. If anything it should be phased out. Because that code is
definitely not always kept up2date, and it's a lot of work to do so.  If
anything the code should be rewritten to *not* require so much
duplication, then we could talk.


> > How much of the source tree would I have to carve out?
> > Or from another perspective; how do other language (if any) solve this?
> 
> I'm not aware of any other language binding for pgtypeslib.

Some people use http://libpqtypes.esilo.com/

Greetings,

Andres Freund


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] Rust bindings to pgtypes lib

2017-07-06 Thread Michael Meskes
> But is this possible, or feasible? I see that the makefile refers to 

Possible yes, but in general I'm not a big fan of duplicating code. I
spend too much time to keep those copies in sync.

> Makefile.global, and also includes stuff from ecpg, aat least. I don't want 
> to 

Yes, but these should be minor. Makefile.global is mostly included for
some rules and other than some includes I don't know what else is taken
from ecpg.

However, there are a couple small files that are taken from teh backend
source tree, like pgstrcasecmp.c

> How much of the source tree would I have to carve out?
> Or from another perspective; how do other language (if any) solve this?

I'm not aware of any other language binding for pgtypeslib.

Michael
-- 
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Meskes at (Debian|Postgresql) dot Org
Jabber: michael at xmpp dot meskes dot org
VfL Borussia! Força Barça! Go SF 49ers! Use Debian GNU/Linux, PostgreSQL


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers