forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitf9b3b3f
committed
Teach flatten_reloptions() to quote option values safely.
flatten_reloptions() supposed that it didn't really need to do anythingbeyond inserting commas between reloption array elements. However, inprinciple the value of a reloption could be nearly anything, since thegrammar allows a quoted string there. Any restrictions on it would comefrom validity checking appropriate to the particular option, if any.A reloption value that isn't a simple identifier or number could thus leadto dump/reload failures due to syntax errors in CREATE statements issuedby pg_dump. We've gotten away with not worrying about this so far withthe core-supported reloptions, but extensions might allow reloption valuesthat cause trouble, as in bug #13840 from Kouhei Sutou.To fix, split the reloption array elements explicitly, and then convertany value that doesn't look like a safe identifier to a string literal.(The details of the quoting rule could be debated, but this way is safeand requires little code.) While we're at it, also quote reloption namesif they're not safe identifiers; that may not be a likely problem in thefield, but we might as well try to be bulletproof here.It's been like this for a long time, so back-patch to all supportedbranches.Kouhei Sutou, adjusted some by me1 parent76eccf0 commitf9b3b3f
1 file changed
+52
-11
lines changedLines changed: 52 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9396 | 9396 |
| |
9397 | 9397 |
| |
9398 | 9398 |
| |
9399 |
| - | |
9400 |
| - | |
| 9399 | + | |
| 9400 | + | |
| 9401 | + | |
| 9402 | + | |
9401 | 9403 |
| |
9402 |
| - | |
9403 |
| - | |
9404 |
| - | |
9405 |
| - | |
9406 |
| - | |
9407 |
| - | |
9408 |
| - | |
9409 |
| - | |
9410 |
| - | |
| 9404 | + | |
| 9405 | + | |
| 9406 | + | |
| 9407 | + | |
| 9408 | + | |
| 9409 | + | |
| 9410 | + | |
| 9411 | + | |
| 9412 | + | |
| 9413 | + | |
| 9414 | + | |
| 9415 | + | |
| 9416 | + | |
| 9417 | + | |
| 9418 | + | |
| 9419 | + | |
| 9420 | + | |
| 9421 | + | |
| 9422 | + | |
| 9423 | + | |
| 9424 | + | |
| 9425 | + | |
| 9426 | + | |
| 9427 | + | |
| 9428 | + | |
| 9429 | + | |
| 9430 | + | |
| 9431 | + | |
| 9432 | + | |
| 9433 | + | |
| 9434 | + | |
| 9435 | + | |
| 9436 | + | |
| 9437 | + | |
| 9438 | + | |
| 9439 | + | |
| 9440 | + | |
| 9441 | + | |
| 9442 | + | |
| 9443 | + | |
| 9444 | + | |
| 9445 | + | |
| 9446 | + | |
| 9447 | + | |
| 9448 | + | |
| 9449 | + | |
| 9450 | + | |
| 9451 | + | |
9411 | 9452 |
| |
9412 | 9453 |
| |
9413 | 9454 |
| |
|
0 commit comments
Comments
(0)