0

I have the trigger in SQL Server database which extract a plain text from rtf field and store it in other field

update table set plaintxt=dbo.gettextfrom_rtf(rtf_field) where id=ID;

I use SQLCLR function dbo.gettextfrom_rtf, it is my c# extractor.

How I can do it in PostgreSQL trigger? I.e. How to implement RTF->plain text in PostgreSQL function?

ZedZip
  • 5,794
  • 15
  • 66
  • 119

1 Answers1

0

There's nothing built-in, and I can't find any existing implementations. You could:

  • Use some kind of regex-based kludge, though it's not going to be perfect
  • Find some simple procedural implementation and port it to PL/pgSQL (here's one in T-SQL)
  • Write a simple wrapper for some existing RTF library in another procedural language like PL/Perl or PL/Python (probably easiest and most reliable, but will require superuser permissions)
Nick Barnes
  • 19,816
  • 3
  • 51
  • 63