Этот баннер — требование Роскомнадзора для исполнения 152 ФЗ.
«На сайте осуществляется обработка файлов cookie, необходимых для работы сайта, а также для анализа использования сайта и улучшения предоставляемых сервисов с использованием метрической программы Яндекс.Метрика. Продолжая использовать сайт, вы даёте согласие с использованием данных технологий».
Политика конфиденциальности
|
|
|
current_timestamp
|
|||
|---|---|---|---|
|
#18+
Уважаемые. Подскажите плиз как такое может быть. Две транзакции -- в первой увеличиваю значение поля t1.balance где t1.id=1 на значение допустим 5. Затем присваиваю в другой таблице полю значение t2.dt=current_timestamp, t2.leftBalance=t1.balance где t2.id=2. -- вторая транзакция ждет пока снимется блокировка с t2.balance где t1.id=1 и тоже увеличивает его на 5 и затем присваиваем полю значение t2.dt=current_timestamp,t2.leftBalance=t1.balance где t2.id=3. в результате получаем t2.balance где t2.id=2 < t2.balance где t2.id=3 а t2.dt где t2.id=2 > t2.dt где t2.id=3 то есть current_timestamp вызванная позднее вернула меньший результат чем первый вызов current_timestamp. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 17.01.2007, 16:47 |
|
||
|
current_timestamp
|
|||
|---|---|---|---|
|
#18+
Kak to u Vas nemnogo putano vse napisano. No delo v tom, chto current_timestamp vsegda ukazyvaet na nachalo transactsii i ne meniatsia vnutri nee. Tak chto esli u vas transactsia dlitsia nedeliu, to current_timestamp v kontse transactsii budet imet' to je znachenie chto v ee nachale -- tak trebuet SQL standart. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 17.01.2007, 17:24 |
|
||
|
current_timestamp
|
|||
|---|---|---|---|
|
#18+
А если вы хотите время именно текущее("моментальное") время, а не время начала транзакции, используйте now() ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 17.01.2007, 18:27 |
|
||
|
current_timestamp
|
|||
|---|---|---|---|
|
#18+
JelisА если вы хотите время именно текущее("моментальное") время, а не время начала транзакции, используйте now() Vy nepravy http://www.postgresql.org/docs/8.2/static/functions-datetime.html#FUNCTIONS-DATETIME-CURRENT Iz doki: now() is a traditional PostgreSQL equivalent to CURRENT_TIMESTAMP. transaction_timestamp() is likewise equivalent to CURRENT_TIMESTAMP, but is named to clearly reflect what it returns. statement_timestamp() returns the start time of the current statement (more specifically, the time of receipt of the latest command message from the client). statement_timestamp() and transaction_timestamp() return the same value during the first command of a transaction, but may differ during subsequent commands. clock_timestamp() returns the actual current time, and therefore its value changes even within a single SQL command. timeofday() is a historical PostgreSQL function. Like clock_timestamp(), it returns the actual current time, but as a formatted text string rather than a timestamp with time zone value. Код: plaintext 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. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 17.01.2007, 18:33 |
|
||
|
current_timestamp
|
|||
|---|---|---|---|
|
#18+
Упс, извините, погорячился :-) Конечно же timeofday() а не now()! А transaction_ и clock_ появились только в 8.2. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 17.01.2007, 18:54 |
|
||
|
|

start [/forum/topic.php?fid=53&msg=34262955&tid=2005795]: |
0ms |
get settings: |
7ms |
get forum list: |
17ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
52ms |
get topic data: |
11ms |
get forum data: |
2ms |
get page messages: |
46ms |
get tp. blocked users: |
2ms |
| others: | 236ms |
| total: | 379ms |

| 0 / 0 |
