Search Postgresql Archives

Re: back slash separated values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"surabhi.ahuja" <surabhi.ahuja@xxxxxxxxxxx> writes:
> mod_pattern := mod_of_study || ''\\'' ||  $2;

If this is in a function body, you need four backslashes not two, for
the same reason that you need to double the quote marks: one level of
quotes and backslashes is eaten when the function body is parsed as a
string literal.

If you are on a recent PG version, you should consider switching to
dollar-quotes for the function body.  Then you don't need to double
anything, and the constant looks the same as it would look in plain
SQL: mod_of_study || '\\' || $2;

			regards, tom lane


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux