Below is the column response from my Postgres table. I want to extract the status from all the rows in my Postgres database. The status could be of varying sizes like SUCCESS
as well so I do not want to use the substring function. Is there a way to do it?
<?xml version="1.0" ?><response><status>ERROR_MISSING_DATA</status><responseType>COUNTRY_MISSING</responseType><country_info>USA</country_info><phone_country_code>1234</phone_country_code></response>
so my table structure is like this
Column | Type | Modifiers
-------------+-----------------------------+----------------------------------------------------------
id | bigint | not null default nextval('events_id_seq'::regclass)
hostname | text | not null
time | timestamp without time zone | not null
trn_type | text |
db_ret_code | text |
request | text |
response | text |
wait_time | text |
And I want to extract status from each and every request. How do i do this?
Below is a sample row. And assume the table name abc_events
id | 1870667
hostname | abcd.local
time | 2013-04-16 00:00:23.861
trn_type | A
request | <?xml version="1.0" ?><response><status>ERROR_MISSING_DATA</status><responseType>COUNTRY_MISSING</responseType><country_info>USA</country_info><phone_country_code>1234</phone_country_code></response>
response | <?xml version="1.0" ?><response><status>ERROR_MISSING_DATA</status><responseType>COUNTRY_MISSING</responseType><country_info>USA</country_info><phone_country_code>1234</phone_country_code></response>