Hi Alex:
Thanks a lot for your fast response and for your input!
Am 08.09.17 14:44 schrieb(en) Alexander Thurgood:
How are you connecting to your pg database ?
Via a JDBC driver or using the native postgres driver provided within LibreOffice ?
Depending on which one you are using, support for a given data type, in this case, an array, might
be different (I don't know off-hand, I haven't tested).
I use the native connector, on a Debian 9 aka stretch Linux boxe; sorry for omitting this
information in my first post…
It can actually deal properly with array data afaict; in the table view, it is displayed in the
“usual” Postgres style (i.e. in braces).
Using a macro that takes your form control text and inserts it into a preparedStatement object, it
would/should probably be possible. I doubt that the Form GUI supports this kind of thing directly
though (but I'm far from being an expert with postgres data type support in LibreOffice).
As you mention, it might be more efficient to do this via a stored procedure in the backend rather
than fudging something in the frontend.
Hmmm, thinking again about it, if I have to write a stored procedure anyway, it is probably easier
to change the data base model and replace the array of single-line texts by a single multiline
text. All the validation work would be performed in a post-insert or -update trigger function in
Postgres. And it saves me the time to learn coding macros in Libreoffice (lazy me). For the data
consumer (not Libreoffice), it doesn't make a big difference; to keep the API as it is now, I just
write an other stored procedure splitting the multilines into arrays.
> Or is there an other "standard" way for dealing with array data types?
>
Not without using macros, that I know of, but I would love to be proven wrong.
The ability to deal with arrays would be a cool extension for Libreoffice (IIRC, arrays are part of
the SQL standard).
Thanks again,
cheers,
Albrecht.
--
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.