- Notifications
You must be signed in to change notification settings - Fork5
Commit1be17f1
committed
>>You can alias $0, similar to the argument variables. And, I confirmed
>>that you cannot change the value, similar to the argument variables:>> Perhaps you shouldn't mark it isconst; then it would actually have some> usefulness (you could use it directly as a temporary variable to hold> the intended result). I can't see much value in aliasing it if it's> const, either.OK; the only change in this version is "isconst = false;". Now you canuse $0 as a result placeholder if desired. E.g.:create or replace function tmp(anyelement, anyelement) returns anyarray as 'declare v_ret alias for $0; v_el1 alias for $1; v_el2 alias for $2;begin v_ret := ARRAY[v_el1, v_el2]; return v_ret;end;' language 'plpgsql';create table f(f1 text, f2 text, f3 int, f4 int);insert into f values ('a','b',1,2);insert into f values ('z','x',3,4);select tmp(f1,f2) from f;select tmp(f3,f4) from f;Joe Conway1 parent9df0306 commit1be17f1
1 file changed
+37
-1
lines changedLines changed: 37 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
6 |
| - | |
| 6 | + | |
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
| |||
361 | 361 |
| |
362 | 362 |
| |
363 | 363 |
| |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
364 | 400 |
| |
365 | 401 |
| |
366 | 402 |
| |
|
0 commit comments
Comments
(0)