以'(quote)开头的字符串,在PostgreSQL中以$ txt $结尾

问题描述 投票:0回答:1

我需要在PostgreSQL中执行以下命令

选择'test $ txt $(字符串以引号开头,以$ txt $结尾)

有可能吗?

php sql database postgresql sql-injection
1个回答
1
投票

要构造字符串文字'test$txt$,您可以使用以下选项:

  • 将单引号加倍:

    SELECT '''test$txt$'
    
  • 使用美元报价,其字符串不同于txt

    SELECT $new$'test$txt$$new$
    
© www.soinside.com 2019 - 2024. All rights reserved.