Oracle to Postgres migration

From: bimal maity <bimal(dot)af2020(at)gmail(dot)com>
To: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Oracle to Postgres migration
Date: 2023-12-20 03:35:03
Message-ID: CACr=-MVXLEzc48BYOFDA7qAUXP6bJnkcuC5w3UJEDEaDOHWjvg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi,

I have below query used in Oracle but while migrating to Postgres this code
is not supported in Postgres.
Could you please tell me how to resolve this?

SELECT p.id_po, p.line_number,
replace(replace(replace(RTRIM(XMLAGG(XMLELEMENT(name C,
regexp_replace(p.protocol_number,'([[:cntrl:]])','', 'g'))ORDER BY 1), ','
) ,'</C><C>','/'),'<C>',''),'</C>','') AS protocol_number

,replace(replace(replace(RTRIM(XMLAGG(XMLELEMENT(name C,
regexp_replace(p.protocol_status,'([[:cntrl:]])','', 'g'))ORDER BY 1), ','
) ,'</C><C>','/'),'<C>',''),'</C>','') AS protocol_status

,replace(replace(replace(RTRIM(XMLAGG(XMLELEMENT(name C,
regexp_replace(p.protocol_approver,'([[:cntrl:]])','', 'g'))ORDER BY 1),
',' ) ,'</C><C>','/'),'<C>',''),'</C>','') AS protocol_approver
,max(p.protocol_date) AS protocol_date

,replace(replace(replace(RTRIM(XMLAGG(XMLELEMENT(name C,
regexp_replace(p.protocol_nota,'([[:cntrl:]])','', 'g'))ORDER BY 1), ',' )
,'</C><C>','/'),'<C>',''),'</C>','') AS protocol_nota
,sum(coalesce(p.protocol_value,0)) protocol_value
FROM podl_extended_protocol p
where upper(p.protocol_status) not in
('REJEITADO','ELIMINADO')
group by p.id_po, p.line_number

Thanks,
Bimal

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message SOzcn 2023-12-20 06:14:57 Re: Timestamps in outputs
Previous Message Rambabu V 2023-12-20 01:52:06 Re: Need inputs on postgresql HA with consul cluster