plpgsql & string building

From: Wells Oliver <wells(dot)oliver(at)gmail(dot)com>
To: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: plpgsql & string building
Date: 2020-02-09 23:12:07
Message-ID: CAOC+FBWLJzmzdvpqC9=xjn=z32t_miSu7ycNrOYyXSgvbjCjcA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

This is probably obvious, but I have this in a plpgsql function, where
GROUPINGS is a text[]:

SQLSTR := 'SELECT foo,'|| 'bar' = any(GROUPINGS) || ', col2, col3...';

I end up with SQLSTR containin the literal any() statement: *SELECT foo,
'|| 'bar' = any(GROUPINGS) || ', col2, col3*

vs it being coming out like *SELECT foo, t, col2, col3.*

What am I missing here?

--
Wells Oliver
wells(dot)oliver(at)gmail(dot)com <wellsoliver(at)gmail(dot)com>

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message David G. Johnston 2020-02-10 00:12:03 Re: plpgsql & string building
Previous Message Murali Paramu 2020-02-09 12:13:02 Run 9.4 & 12 version of PostgreSQL on same PC