Comment 1 for bug 1400376

Revision history for this message
Mike Rylander (mrylander) wrote :

The postgres docs do not suggest that hstore has a problem storing NULL values: http://www.postgresql.org/docs/9.2/static/hstore.html ... I'd be concerned about a mis-diagnosis here, unless you've found that hstore is truly not acting as documented.

However, if you do want to force the metabib.record_attr view to exclude NULLs, I would recommend this instead:

CREATE VIEW metabib.record_attr AS
     SELECT id, HSTORE( ARRAY_AGG( attr ), ARRAY_AGG( value ) ) AS attrs FROM metabib.record_attr_flat WHERE value IS NOT NULL GROUP BY 1;

That way you're not changing something used by other code without having inspected that other code.