-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(pgsql) add test for $$ quoting existing behavior
- even if that existing behavior is questionable - the ending span should really close before the $$, not after Fixing this would involve delving into the sublanguage behavior and I'm not sure we have time to tackle that right this moment.
- Loading branch information
1 parent
6d7b805
commit ebb78fa
Showing
2 changed files
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<span class="hljs-keyword">CREATE</span> <span class="hljs-keyword">OR REPLACE</span> <span class="hljs-keyword">FUNCTION</span> hello_world(param_your_name <span class="hljs-type">text</span>) | ||
<span class="hljs-keyword">RETURNS</span> <span class="hljs-type">text</span> <span class="hljs-keyword">AS</span> | ||
$$<span class="ruby"> | ||
SELECT <span class="hljs-string">'Hello world. My name is '</span> <span class="hljs-params">||</span> param_your_name <span class="hljs-params">||</span> <span class="hljs-string">'.'</span>; | ||
$$</span> | ||
<span class="hljs-keyword">language</span> <span class="hljs-keyword">sql</span> <span class="hljs-keyword">STRICT</span>; | ||
|
||
<span class="hljs-keyword">SELECT</span> sql_expression($sql$<span class="ruby">SELECT hello_world($phrase$Regina<span class="hljs-string">'s elephant'</span>s dog$phrase$) | ||
<span class="hljs-params">||</span> $phrase$ I made a cat<span class="hljs-string">'s meow today.$phrase$ $sql$</span></span>); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
CREATE OR REPLACE FUNCTION hello_world(param_your_name text) | ||
RETURNS text AS | ||
$$ | ||
SELECT 'Hello world. My name is ' || param_your_name || '.'; | ||
$$ | ||
language sql STRICT; | ||
|
||
SELECT sql_expression($sql$SELECT hello_world($phrase$Regina's elephant's dog$phrase$) | ||
|| $phrase$ I made a cat's meow today.$phrase$ $sql$); |