On 2012-06-11, at 3:43 AM, Marc Balmer wrote:
Sitting in one of the nice pubs in Edinburgh during KohaCon, I had this idea to add MARC records as a proper datatype to the PostgreSQL database server. After a discussion with Marc Véron and Dobrica Pavlinusic about what that could mean, I decided to just try it and I have now a basic implementation (or, more a proof of concept). So here is some information on this:
If MARC records are a proper datatype, that means they are stored right in the database, are backed-up, can be restored, replicated etc. just with the standard database tools. If then a function is provided to access individual fields of a MARC record, then this can be used in SQL expressions, e.g. for selects or to create views etc. As PostgreSQL supports functional indexes, you can create indexes on individual MARC fields, giving you super fast access to your data.
To access individual MARC fields, the function 'marc_field()' was created, it returns VARCHAR:
wow, very impressive stuff! could someone please paste the code of the 'marc_field() function?