forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitfb32748
committed
Switch SQLValueFunction on "name" to use COERCE_SQL_SYNTAX
This commit changes six SQL keywords to use COERCE_SQL_SYNTAX ratherthan relying on SQLValueFunction:- CURRENT_ROLE- CURRENT_USER- USER- SESSION_USER- CURRENT_CATALOG- CURRENT_SCHEMAAmong the six, "user", "current_role" and "current_catalog" requirespecific SQL functions to allow ruleutils.c to map them to the SQLkeywords these require when using COERCE_SQL_SYNTAX. Havingpg_proc.proname match with the keyword ensures that the compatibilityremains the same when projecting any of these keywords in a FROM clauseto an attribute name when an alias is not specified. This is covered bythe tests added in2e0d80c, making sure that a correct mapping happenswith each SQL keyword. The three others (current_schema, session_userand current_user) already have pg_proc entries for this job, so thisbrings more consistency between the way such keywords are treated in theparser, the executor and ruleutils.c.SQLValueFunction is reduced to half its contents after this change,simplifying its logic a bit as there is no need to enforce a C collationanymore for the entries returning a name as a result. I have made a fewperformance tests, with a million-ish calls to these keywords withoutseeing a difference in run-time or in perf profiles(ExecEvalSQLValueFunction() is removed from the profiles). Theremaining SQLValueFunctions are now related to timestamps and dates.Bump catalog version.Reviewed-by: Corey HuinkerDiscussion:https://postgr.es/m/YzaG3MoryCguUOym@paquier.xyz1 parented1d313 commitfb32748
File tree
9 files changed
+56
-93
lines changed- src
- backend
- executor
- nodes
- parser
- utils/adt
- include
- catalog
- nodes
9 files changed
+56
-93
lines changedLines changed: 0 additions & 27 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2495 | 2495 |
| |
2496 | 2496 |
| |
2497 | 2497 |
| |
2498 |
| - | |
2499 | 2498 |
| |
2500 | 2499 |
| |
2501 | 2500 |
| |
2502 | 2501 |
| |
2503 |
| - | |
2504 |
| - | |
2505 |
| - | |
2506 |
| - | |
2507 | 2502 |
| |
2508 | 2503 |
| |
2509 | 2504 |
| |
| |||
2525 | 2520 |
| |
2526 | 2521 |
| |
2527 | 2522 |
| |
2528 |
| - | |
2529 |
| - | |
2530 |
| - | |
2531 |
| - | |
2532 |
| - | |
2533 |
| - | |
2534 |
| - | |
2535 |
| - | |
2536 |
| - | |
2537 |
| - | |
2538 |
| - | |
2539 |
| - | |
2540 |
| - | |
2541 |
| - | |
2542 |
| - | |
2543 |
| - | |
2544 |
| - | |
2545 |
| - | |
2546 |
| - | |
2547 |
| - | |
2548 |
| - | |
2549 |
| - | |
2550 | 2523 |
| |
2551 | 2524 |
| |
2552 | 2525 |
| |
|
Lines changed: 3 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
917 | 917 |
| |
918 | 918 |
| |
919 | 919 |
| |
920 |
| - | |
921 |
| - | |
922 |
| - | |
923 |
| - | |
924 |
| - | |
| 920 | + | |
| 921 | + | |
925 | 922 |
| |
926 | 923 |
| |
927 | 924 |
| |
| |||
1144 | 1141 |
| |
1145 | 1142 |
| |
1146 | 1143 |
| |
1147 |
| - | |
1148 |
| - | |
1149 |
| - | |
| 1144 | + | |
1150 | 1145 |
| |
1151 | 1146 |
| |
1152 | 1147 |
| |
|
Lines changed: 24 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
15231 | 15231 |
| |
15232 | 15232 |
| |
15233 | 15233 |
| |
15234 |
| - | |
| 15234 | + | |
| 15235 | + | |
| 15236 | + | |
| 15237 | + | |
15235 | 15238 |
| |
15236 | 15239 |
| |
15237 | 15240 |
| |
15238 |
| - | |
| 15241 | + | |
| 15242 | + | |
| 15243 | + | |
| 15244 | + | |
15239 | 15245 |
| |
15240 | 15246 |
| |
15241 | 15247 |
| |
15242 |
| - | |
| 15248 | + | |
| 15249 | + | |
| 15250 | + | |
| 15251 | + | |
15243 | 15252 |
| |
15244 | 15253 |
| |
15245 | 15254 |
| |
| |||
15250 | 15259 |
| |
15251 | 15260 |
| |
15252 | 15261 |
| |
15253 |
| - | |
| 15262 | + | |
| 15263 | + | |
| 15264 | + | |
| 15265 | + | |
15254 | 15266 |
| |
15255 | 15267 |
| |
15256 | 15268 |
| |
15257 |
| - | |
| 15269 | + | |
| 15270 | + | |
| 15271 | + | |
| 15272 | + | |
15258 | 15273 |
| |
15259 | 15274 |
| |
15260 | 15275 |
| |
15261 |
| - | |
| 15276 | + | |
| 15277 | + | |
| 15278 | + | |
| 15279 | + | |
15262 | 15280 |
| |
15263 | 15281 |
| |
15264 | 15282 |
| |
|
Lines changed: 0 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2231 | 2231 |
| |
2232 | 2232 |
| |
2233 | 2233 |
| |
2234 |
| - | |
2235 |
| - | |
2236 |
| - | |
2237 |
| - | |
2238 |
| - | |
2239 |
| - | |
2240 |
| - | |
2241 |
| - | |
2242 | 2234 |
| |
2243 | 2235 |
| |
2244 | 2236 |
| |
|
Lines changed: 0 additions & 18 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1895 | 1895 |
| |
1896 | 1896 |
| |
1897 | 1897 |
| |
1898 |
| - | |
1899 |
| - | |
1900 |
| - | |
1901 |
| - | |
1902 |
| - | |
1903 |
| - | |
1904 |
| - | |
1905 |
| - | |
1906 |
| - | |
1907 |
| - | |
1908 |
| - | |
1909 |
| - | |
1910 |
| - | |
1911 |
| - | |
1912 |
| - | |
1913 |
| - | |
1914 |
| - | |
1915 |
| - | |
1916 | 1898 |
| |
1917 | 1899 |
| |
1918 | 1900 |
| |
|
Lines changed: 18 additions & 18 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9169 | 9169 |
| |
9170 | 9170 |
| |
9171 | 9171 |
| |
9172 |
| - | |
9173 |
| - | |
9174 |
| - | |
9175 |
| - | |
9176 |
| - | |
9177 |
| - | |
9178 |
| - | |
9179 |
| - | |
9180 |
| - | |
9181 |
| - | |
9182 |
| - | |
9183 |
| - | |
9184 |
| - | |
9185 |
| - | |
9186 |
| - | |
9187 |
| - | |
9188 |
| - | |
9189 |
| - | |
9190 | 9172 |
| |
9191 | 9173 |
| |
9192 | 9174 |
| |
| |||
10288 | 10270 |
| |
10289 | 10271 |
| |
10290 | 10272 |
| |
| 10273 | + | |
| 10274 | + | |
| 10275 | + | |
| 10276 | + | |
| 10277 | + | |
| 10278 | + | |
| 10279 | + | |
| 10280 | + | |
| 10281 | + | |
| 10282 | + | |
| 10283 | + | |
| 10284 | + | |
| 10285 | + | |
| 10286 | + | |
| 10287 | + | |
| 10288 | + | |
| 10289 | + | |
| 10290 | + | |
10291 | 10291 |
| |
10292 | 10292 |
| |
10293 | 10293 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
57 | 57 |
| |
58 | 58 |
| |
59 | 59 |
| |
60 |
| - | |
| 60 | + | |
61 | 61 |
| |
62 | 62 |
|
Lines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1505 | 1505 |
| |
1506 | 1506 |
| |
1507 | 1507 |
| |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
1508 | 1517 |
| |
1509 | 1518 |
| |
1510 | 1519 |
| |
|
Lines changed: 1 addition & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1313 | 1313 |
| |
1314 | 1314 |
| |
1315 | 1315 |
| |
1316 |
| - | |
1317 |
| - | |
1318 |
| - | |
1319 |
| - | |
1320 |
| - | |
1321 |
| - | |
1322 |
| - | |
| 1316 | + | |
1323 | 1317 |
| |
1324 | 1318 |
| |
1325 | 1319 |
| |
|
0 commit comments
Comments
(0)