Skip to content

Commit 78bcf76

Browse files
authored
Create escape-single-quote.md
1 parent 2878790 commit 78bcf76

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

postgresql/escape-single-quote.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Escaping Single Quotes
2+
3+
According to the SQL standard escaping single quotes should be done with another single quote.
4+
5+
```sql
6+
INSERT INTO mytable (name) VALUES ('Shaquille O''Neal')
7+
```
8+
9+
Note: See the two single quotes in `O''Neal`
10+
11+
-----
12+
13+
### Refs
14+
15+
- [PostgreSQL Docs - String Constants](https://www.postgresql.org/docs/16/sql-syntax-lexical.html#SQL-SYNTAX-STRINGS)

0 commit comments

Comments
 (0)