Re: [dspace-tech] PostgreSQL Queries for DSpace 6.2

2017-11-22 Thread Stacy Pennington
Thanks, Tim. Those are some very useful DB functions for making it much easier to query DSpace's very normalized and efficient table definitions. I'll definitely build my custom queries around those helper functions. Stacy On Wednesday, November 22, 2017 at 10:11:52 AM UTC-6, Tim Donohue wrote:

Re: [dspace-tech] PostgreSQL Queries for DSpace 6.2

2017-11-22 Thread Stacy Pennington
Thanks, Terry! That altered query does work and provides a good, flattened list that can be used to compare topologies, as we go through the process of simplifying our overall structure. Yes, we've been suffering with the en_us DC issue with mass metadata editing via CSV. We are in the process

Re: [dspace-tech] PostgreSQL Queries for DSpace 6.2

2017-11-22 Thread Tim Donohue
Hi Stacy, Just as a quick FYI, some "helper SQL functions" have been gathered on the wiki at: https://wiki.duraspace.org/display/DSPACE/Helper+SQL+functions+for+DSpace+6 These functions make querying the DSpace 6 database a bit easier (see examples on that page). - Tim On Thu, Nov 16, 2017 at 2

Re: [dspace-tech] PostgreSQL Queries for DSpace 6.2

2017-11-21 Thread Terry Brady
I imagine that there is one of 2 reasons why this did not work. My query did not address these scenarios. 1. You have 2 schemas loaded that each have an element of title 2. You have titles in multiple languages The following query has a placeholder for language commented out if that is the scen

Re: [dspace-tech] PostgreSQL Queries for DSpace 6.2

2017-11-21 Thread Stacy Pennington
Terry, sorry for the delayed reply. I'm getting an error with that new query: ERROR: more than one row returned by a subquery used as an expression ** Error ** ERROR: more than one row returned by a subquery used as an expression SQL state: 21000 Do you think it is likely that

Re: [dspace-tech] PostgreSQL Queries for DSpace 6.2

2017-11-17 Thread Terry Brady
Stacy, I just realized that I tested the query in my DSpace 5 instance. Try the following instead. with recursive r_comm2coll as ( select community_id, collection_id from community2collection union select cm2cm.parent_comm_id as community_id, r.collection_id from

Re: [dspace-tech] PostgreSQL Queries for DSpace 6.2

2017-11-17 Thread Stacy Pennington
Terry, Thanks for the excellent advice regarding using /rest/hierarchy. I was able to get a (long) list that could be easily cleaned up in Excel and used to track the flattening of the hierarchy. I only started using the REST API a few months ago, but I'm really excited about what it can do. W

Re: [dspace-tech] PostgreSQL Queries for DSpace 6.2

2017-11-16 Thread Terry Brady
Do you have the REST API enabled? The following endpoint will provide a dump of the hierarchy that is easy to parse. https://demo.dspace.org/rest/hierarchy If that does not help, here are some SQL that might help. with recursive r_comm2coll as ( select community_id, collection_id fr

[dspace-tech] PostgreSQL Queries for DSpace 6.2

2017-11-16 Thread Stacy Pennington
Does anyone out there have some useful PostgreSQL queries already written for DSpace 6.2? I've found several sets of PostgreSQL queries that were useful for earlier versions of DSpace, but most of them appear to be written between the versions 1.8 and 4.x, and the database changes from the past