microo8 / plgo

easily create postgresql extensions in golang; moved to gitlab.com/microo8/plgo
292 stars 23 forks source link

Function "Sub" has not suported return type #15

Closed sachaarbonel closed 6 years ago

sachaarbonel commented 6 years ago

Hi @microo8 I have this issue when I run plgo in my package https://github.com/Sach97/vector-operation However I've seen in your code that you have implemented the type conversion []float64 to double precision[]. I don't know what I did wrong it works fine when I run "go run main.go". Do you have an idea of what I could change in my code to run plgo ?

microo8 commented 6 years ago

plgo doesn't support returning an array type. But I can check what can be done :)

microo8 commented 6 years ago

This wasn't difficult :) the new version supports array as the return type of a function.

Just update plgo to the lastest version: go get -u github.com/microo8/plgo/...

I've tried it on your Sub function:

postgres=# select Sub(array[1,0,3],array[1,0,3]);
   sub
---------
 {0,0,0}
(1 row)

Close this issue please if it works for you.

sachaarbonel commented 6 years ago

Thank's a lot it worked ! I'll try make a pull request if I find other wired types in my use case now that I know where happens the logic of types.