How to perform text merge - Mailing list pgsql-general

From Andrus
Subject How to perform text merge
Date
Msg-id 609BF3CE079445569FC0D047A5C816AD@andrusnotebook
Whole thread Raw
Responses Re: How to perform text merge
List pgsql-general
Database column contains merge data in text column.
Expressions are between << and >> separators.
How to replace them with database values ?

For example, code below should return:

Hello Tom Lane!

How to implement textmerge procedure or other idea ?

Andrus.

create temp table person ( firstname text, lastname text ) on commit drop;
insert into person values ('Tom', 'Lane');
create temp table mergedata ( template text ) on commit drop;
insert into mergedata values ('Hello <<firstname||'' ''||lastname>>!');

select textmerge(template,'select * from person') from mergedata;


pgsql-general by date:

Previous
From: "Andrus"
Date:
Subject: Splitting text column to multiple rows
Next
From: Pavel Stehule
Date:
Subject: Re: Splitting text column to multiple rows