|
|
|
WITH AS, UPSERT, RETURNING
|
|||
|---|---|---|---|
|
#18+
Добрый день. Помогите разобраться: с закоменчеными строками работает, а если раскомментить строки, то получаю синтаксическую ошибку Код: sql 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. авторОШИБКА: таблица "s" отсутствует в предложении FROM LINE 19: RETURNING s.f1, s.f2 -- not the underlying table that th... ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 17.07.2015, 10:18 |
|
||
|
WITH AS, UPSERT, RETURNING
|
|||
|---|---|---|---|
|
#18+
автор-- not the underlying table that the statement modifiesчем отличаются значения, получившиеся в underlying table, от значений источника? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 17.07.2015, 10:57 |
|
||
|
WITH AS, UPSERT, RETURNING
|
|||
|---|---|---|---|
|
#18+
samoxod, В документации написано: авторThe optional RETURNING clause causes INSERT to compute and return value(s) based on each row actually inserted . This is primarily useful for obtaining values that were supplied by defaults, such as a serial sequence number. However, any expression using the table's columns is allowed. The syntax of the RETURNING list is identical to that of the output list of SELECT. В скрипте идет попытка выдать другие поля, то есть не те что указаны в определении таблицы. О чем и сообщено в ошибке. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 17.07.2015, 11:30 |
|
||
|
WITH AS, UPSERT, RETURNING
|
|||
|---|---|---|---|
|
#18+
ursido, Спасибо, я то читал в другом месте : авторWhen writing a data-modifying statement (INSERT, UPDATE or DELETE) in WITH, it is usual to include a RETURNING clause. It is the output of RETURNING, not the underlying table that the statement modifies, that forms the temporary table that is read by the primary query. и видимо неправильно понял про базовую таблицу ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 17.07.2015, 11:49 |
|
||
|
|

start [/forum/topic.php?fid=53&fpage=108&tid=1997873]: |
0ms |
get settings: |
7ms |
get forum list: |
20ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
28ms |
get topic data: |
13ms |
get forum data: |
4ms |
get page messages: |
52ms |
get tp. blocked users: |
2ms |
| others: | 221ms |
| total: | 355ms |

| 0 / 0 |
