By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,302 Members | 1,254 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,302 IT Pros & Developers. It's quick & easy.

Concatenating String Literals in pgsql

P: n/a
How does one concat string literals in pgsql ?

The compiler complains about the concat operator in the following code
fragment:

RAISE EXCEPTION
''SELECT DISTINCT "t1"."usesysid" '' ||
''INTO userID '' ||
''FROM "pg_user" AS "t1" '' ||
''WHERE "t1"."usename" = current_user '' ||
''NOT FOUND'';

Thanks in advance.

Raymond

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 11 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
Raymond <su*****@bigriverinfotech.com> writes:
The compiler complains about the concat operator in the following code
fragment: RAISE EXCEPTION
''SELECT DISTINCT "t1"."usesysid" '' ||
''INTO userID '' ||


RAISE EXCEPTION doesn't support expressions in its arguments, IIRC.
The format has to be a simple string literal, and anything to be plugged
into it has to be a variable reference.

So, do the concatenation beforehand.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 11 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.