Skip to content

Fixing a Bad Matrix/Table #526

@rburghol

Description

@rburghol

@COBrogan FYI: the view dh_properties_fielded fails with certain table data (that is yet to be determined), with the following error sequence:

Error: Failed to fetch row : ERROR:  Unable to decode serialized value, unsupported type:  
CONTEXT:  PL/pgSQL function php_unserialize(text) line 65 at RAISE
PL/pgSQL function php_unserialize(text) line 38 at assignment

Found during Impoundment set up and here is the fix (till we discover the cause):

  • This fails due to broken stage/storage table (I think)
    • imp_prop <- riverseg_model$get_prop('impoundment')
    • So does: imp_json <- ds$get_json_prop(imp_prop$pid)
    • and: stor_json <- ds$get_json_prop(6571770)
    • and get_prop('storage_stage_area') also failed due to reliance on dh_properties_fielded
  • This fixes it:
    • Find the impoundment: select pid,propname from dh_properties where featureid = 6571682;
    • Find the storage table by name (and get pid and vid): select pid,vid,propname from dh_properties where featureid = 6571751;
    • Note: code below the RomProperty$new() call uses FALSE instead of TRUE argument at the end which retrieves the remote
storage_stage_area = RomProperty$new(
  ds,
  list(
    pid=6571770,
    vid=7678675,
    varkey='om_class_DataMatrix',
    featureid=imp_prop$pid,
    propname='storage_stage_area',
    entity_type='dh_properties'
  ), 
  FALSE
)

storage_stage_area$set_matrix(
  data.frame(
    c('storage', 'stage', 'surface_area'),
    c(0, 319.0, 0),
    c(9284, 339.0, 740),
    c(10002.06, 340.0, 750),
    c(18727, 350.0, 1000)
  )
)
storage_stage_area$save(TRUE)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions