Postgresql – Is the double dollar sign ($$) quotation method in SQL standard

postgresqlsql-standard

In PostgreSQL, strings can be quoted very flexibly using a pair of dollar signs ($) with a tag in between. For example,

SELECT $f$ Hi $f$;

Is this quoting mechanism a part of any SQL standard, or is it postgres specific?

Best Answer

NO its postgresql specific many programing languages offer a way to write text that avoids having to be escaped

consider

Select $$";"'\e\r\n$$ 

vs

select '\";\"\'\\e\\r\\n'

Also keep in mind Postgtesql from version 9.1 by default no longer allows passing escape string in a query, it has to have a leading E

select E'\r\n'  

to be escaped now see standard conforming string