Hi Alan,
## Backup your DB (for good measure).
pg_dump --create --oids --format=c --verbose
--file=/opt/pgbackups/db-dspace-YYYY-MM-DD.backup dspace
## I'm sure you don't feel comfortable deleting things through SQL,
especially since the application ought to be able to do this itself. But,
it certainly is expedient.
DELETE from metadatavalue where metadata_field_id=11 and text_value='';
Peter Dietz
On Fri, Jan 6, 2012 at 3:18 AM, Alan Orth <[email protected]> wrote:
> All,
>
> (originally posted in an older thread, but I don't think anyone saw it!)...
>
> I've noticed my stats scripts are failing due to
> incorrect metadata. It appears some items have been
> submitted with two dc.date.accessioned fields; one valid, and one
> empty. An excerpt from when I tried to run the stats manually:
>
> # su -c '/home/dspace/bin/dspace stat-monthly' tomcat55
> Exception: ERROR: invalid input syntax for type timestamp: ""
> org.postgresql.util.PSQLException: ERROR: invalid input syntax for
> type timestamp: ""
> at
> org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1531)
> at
> org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1313)
> at
> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
>
> I've used the following query to find items with empty fields:
>
> select item_id from metadatavalue where metadata_field_id=11 and
> text_value='';
>
> ... but I'm not sure how to delete those metadata fields from the
> item? There are several hundred of these items, so it's not practical to
> get
> their handles and do it manually...
>
> Thanks,
>
> Alan
>
> --
> Alan Orth
> [email protected]
> http://alaninkenya.org
> http://mjanja.co.ke
> "In heaven all the interesting people are missing." -Friedrich Nietzsche
>
>
> ------------------------------------------------------------------------------
> Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
> infrastructure or vast IT resources to deliver seamless, secure access to
> virtual desktops. With this all-in-one solution, easily deploy virtual
> desktops for less than the cost of PCs and save 60% on VDI infrastructure
> costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
> _______________________________________________
> DSpace-tech mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/dspace-tech
>
------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual
desktops for less than the cost of PCs and save 60% on VDI infrastructure
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech