国产精品电影_久久视频免费_欧美日韩国产激情_成年人视频免费在线播放_日本久久亚洲电影_久久都是精品_66av99_九色精品美女在线_蜜臀a∨国产成人精品_冲田杏梨av在线_欧美精品在线一区二区三区_麻豆mv在线看

NOTIFY 中文man頁面

系統
NOTIFY 命令向當前數據庫中所有執行過 LISTEN name, 正在監聽特定通知條件的前端應用發送一個通知事件。

NAME

NOTIFY - 生成一個通知

SYNOPSIS

NOTIFY name        

DESCRIPTION 描述

NOTIFY 命令向當前數據庫中所有執行過 LISTEN name, 正在監聽特定通知條件的前端應用發送一個通知事件。


 傳遞給前端的通知事件包括通知條件名和發出通知的后端進程PID。 數據庫設計者有責任定義用于某個數據庫的條件名和每個通知條件的含義。


 通常,通知條件名與數據庫里的表的名字相同, 通知時間實際上意味著"我修改了此數據庫,請看一眼有什么新東西"。 NOTIFY 和 LISTEN  命令并不強制這種聯系。例如,數據庫設計者可以使用幾個不同的條件名來標志一個表的幾種不同改變。

NOTIFY 為訪問同一個 PostgreSQL 數據庫的一組進程提供了一種簡單的信號形式或進程間通訊機制。 更高級的機制(除了一個簡單的通知名以外)可以通過使用數據庫中的表從通知者傳遞數據到被通知者。


 當NOTIFY用于通知某一特定表修改的動作的發生, 一個實用的編程技巧是將 NOTIFY 放在一個由表更新觸發的規則里。用這種方法, 通知將在表更新的時候自動觸發,而且應用程序員不會碰巧忘記處理它。

NOTIFY 和 SQL 事務用某種重要的方法進行交換。首先,如果 NOTIFY 在事務內部執行,通知事件直到事務提交才會送出。 這么做是有道理的,因為如果事務退出了, 那么在它里面的所有命令都沒有效果 - 包括 NOTIFY。但如果有人希望通知事件立即發送,這就不太好了。 其次,當一個正在監聽的會話在一次事務內收到一個通知信號, 直到本次事務完成(提交或退出)之前,該通知事件將不被送到與之相連的客戶端。 同樣,如果一個通知在事務內部發送出去了, 而該事務稍后又退出了,我們就希望通知可以在某種程度上被撤消- -但通知一旦發送出去,服務器便不能從客戶端"收回"通知。 所以通知時間只是在事務之間傳遞。這一點就要求使用 NOTIFY 作為實時信號的應用應該確保他們的事務盡可能短。

NOTIFY 在一方面的行為象 Unix 的信號: 如果同一條件名在短時間內發出了多條信號,接收者幾次執行 NOTIFY 可能只回收到一條通知信息。 所以依賴于收到的通知條數的方法是很不可靠的。因而,使用 NOTIFY喚醒需要關注某事的應用, 同時還要使用數據庫對象(如序列號)來跟蹤事件發生了幾次。


 客戶端經常會自己發送與正在監聽的通知名一樣的 NOTIFY。 這時它(客戶端)也和其他正在監聽的會話一樣收到一個通知事件。 這樣可能導致一些無用的工作(與應用邏輯有關)-- 例如, 對客戶端剛寫過的表又進行一次讀操作以發現是否有更新。 我們可以通過檢查服務器進程的PID(在通知事件中提供) 是否與自己的后端的PID一致(從 libpq 中取得)。當他們一樣時, 說明這是其自身回彈的信息,可以忽略。(不管前面章節是如何講的,這是一個安全的技巧。 PostgreSQL 保持自身的通知和其他到來的通知區分開。 所以你屏蔽了自己的通知后不會略過外部的通知。)  

PARAMETERS 參數

name

 生成信號(通知)的通知條件(任何標識符)。

EXAMPLES 例子


 在 psql 里配置和執行一個監聽/通知對:

LISTEN virtual;
NOTIFY virtual;
Asynchronous notification "virtual" received from server process with PID 8448.

COMPATIBILITY 兼容性


 在 SQL 標準里沒有 NOTIFY 語句。  

SEE ALSO 參見

LISTEN [listen(7)], UNLISTEN [unlisten(l)]

  #p#

NAME

NOTIFY - generate a notification

SYNOPSIS

NOTIFY name        

DESCRIPTION

The NOTIFY command sends a notification event to each client application that has previously executed LISTEN name for the specified notification name in the current database.

The information passed to the client for a notification event includes the notification name and the notifying session's server process PID. It is up to the database designer to define the notification names that will be used in a given database and what each one means.

Commonly, the notification name is the same as the name of some table in the database, and the notify event essentially means, ``I changed this table, take a look at it to see what's new''. But no such association is enforced by the NOTIFY and LISTEN commands. For example, a database designer could use several different notification names to signal different sorts of changes to a single table.

NOTIFY provides a simple form of signal or interprocess communication mechanism for a collection of processes accessing the same PostgreSQL database. Higher-level mechanisms can be built by using tables in the database to pass additional data (beyond a mere notification name) from notifier to listener(s).

When NOTIFY is used to signal the occurrence of changes to a particular table, a useful programming technique is to put the NOTIFY in a rule that is triggered by table updates. In this way, notification happens automatically when the table is changed, and the application programmer can't accidentally forget to do it.

NOTIFY interacts with SQL transactions in some important ways. Firstly, if a NOTIFY is executed inside a transaction, the notify events are not delivered until and unless the transaction is committed. This is appropriate, since if the transaction is aborted, all the commands within it have had no effect, including NOTIFY. But it can be disconcerting if one is expecting the notification events to be delivered immediately. Secondly, if a listening session receives a notification signal while it is within a transaction, the notification event will not be delivered to its connected client until just after the transaction is completed (either committed or aborted). Again, the reasoning is that if a notification were delivered within a transaction that was later aborted, one would want the notification to be undone somehow---but the server cannot ``take back'' a notification once it has sent it to the client. So notification events are only delivered between transactions. The upshot of this is that applications using NOTIFY for real-time signaling should try to keep their transactions short.

NOTIFY behaves like Unix signals in one important respect: if the same notification name is signaled multiple times in quick succession, recipients may get only one notification event for several executions of NOTIFY. So it is a bad idea to depend on the number of notifications received. Instead, use NOTIFY to wake up applications that need to pay attention to something, and use a database object (such as a sequence) to keep track of what happened or how many times it happened.

It is common for a client that executes NOTIFY to be listening on the same notification name itself. In that case it will get back a notification event, just like all the other listening sessions. Depending on the application logic, this could result in useless work, for example, reading a database table to find the same updates that that session just wrote out. It is possible to avoid such extra work by noticing whether the notifying session's server process PID (supplied in the notification event message) is the same as one's own session's PID (available from libpq). When they are the same, the notification event is one's own work bouncing back, and can be ignored. (Despite what was said in the preceding paragraph, this is a safe technique. PostgreSQL keeps self-notifications separate from notifications arriving from other sessions, so you cannot miss an outside notification by ignoring your own notifications.)  

PARAMETERS

name
Name of the notification to be signaled (any identifier).

EXAMPLES

Configure and execute a listen/notify sequence from psql:

LISTEN virtual;
NOTIFY virtual;
Asynchronous notification "virtual" received from server process with PID 8448.

COMPATIBILITY

There is no NOTIFY statement in the SQL standard.  

SEE ALSO

LISTEN [listen(7)], UNLISTEN [unlisten(l)]

責任編輯:韓亞珊 來源: CMPP.net
相關推薦

2011-08-15 10:21:09

man中文man

2011-08-24 16:48:36

man中文man

2011-08-11 16:11:49

at中文man

2011-08-25 10:21:56

man.conf中文man

2011-08-25 09:29:35

udp中文man

2011-08-16 09:56:22

groupdel中文man

2011-08-25 17:03:51

pclose中文man

2011-08-25 16:28:50

fread中文man

2011-08-29 10:39:12

fifo中文man

2011-08-16 10:07:02

id中文man

2011-08-23 10:21:40

blockdev中文man

2011-08-25 17:27:58

rewind中文man

2011-08-23 13:40:31

2011-08-23 16:32:33

smbpasswd中文man

2011-08-24 10:21:39

CHECKPOINT中文man

2011-08-25 10:58:11

shells中文man

2011-08-25 18:16:37

tcflush中文man

2011-08-25 17:49:09

stdin中文man

2011-08-25 15:05:25

cfsetispeed中文man

2011-08-25 15:26:31

execle中文man
點贊
收藏

51CTO技術棧公眾號

亚洲国内精品| 国产精品亚洲一区二区三区妖精| 视频国产精品| 一区二区三区在线视频免费观看| 一区二区三区av| 红杏成人性视频免费看| 日韩性xxxx爱| 最近在线中文字幕| 精品粉嫩超白一线天av| 中文字幕国产精品| 国产高清视频在线播放| 亚洲一区在线观看免费| 日本男人操女人| 久久久久亚洲蜜桃| 日本成人在线免费视频| 久久日韩粉嫩一区二区三区| 免费在线a视频| 91在线观看一区二区| 久久久免费视频网站| 国产亚洲视频系列| 爱情岛论坛亚洲首页入口章节| 国产日韩一级二级三级| 九九热精品在线播放| 久久精品男人天堂av| 在线观看av网页| 日韩美女视频19| 写真福利理论片在线播放| 婷婷亚洲久悠悠色悠在线播放| 午夜视频在线观看韩国| 色婷婷av一区二区三区软件| av在线播放av| 亚洲国产精品va在线| 少妇一区视频| 欧美成人sm免费视频| 台湾亚洲精品一区二区tv| 国产精品一二三视频| 国产亚洲福利| 日本a在线天堂| 欧美国产一区二区在线观看| 成人亚洲成人影院| 一区二区在线观看视频| 色综合888| 亚洲国产精品系列| 国产日韩欧美中文在线| 日韩美女免费视频| 一本久道久久综合狠狠爱| 香蕉视频免费版| 中文字幕一区在线| 日韩在线免费播放| 日韩精品久久久久| 欧美亚洲大陆| 精品国产乱码久久久久| 国产成人一级电影| 宅男深夜国产| 精品国产污网站| 亚洲一区二区三区日本久久九| 国产日韩欧美综合| 视频一区在线播放| 亚洲色图久久久| 欧美日韩一区二区电影| 福利视频亚洲| 国产日韩中文字幕| 久久成人久久爱| 国产九一视频| 精品欧美一区二区三区精品久久| 精品成人18| 国语精品中文字幕| 中文字幕高清不卡| 日韩av官网| 热草久综合在线| 精品一区二区三区免费| 亚欧精品一区| 亚洲免费精彩视频| 免费看国产精品一二区视频| 久久久噜噜噜久噜久久综合| 国产二区在线播放| 孩xxxx性bbbb欧美| 精品亚洲aⅴ乱码一区二区三区| 米奇.777.com| 亚洲色图13p| 国产一区美女| 成全视频在线播放大地| 日韩电影视频免费| 99精品视频在线观看播放| 精品少妇在线视频| 欧美喷潮久久久xxxxx| 欧美交a欧美精品喷水| 99精品视频网站| 91国模大尺度私拍在线视频| 6080亚洲理论片在线观看| 亚洲精品高清视频| 欧美日韩国产精品专区| 欧美aaaaaaaa| 午夜啪啪免费视频| 欧美在线高清视频| 猛男gaygay欧美视频| 成人免费在线网| 日韩精品一区二区三区视频播放| 亚洲精品3区| 色婷婷综合久久久久中文字幕| 亚洲国产日韩欧美在线99| 欧美 亚欧 日韩视频在线| 亚洲黄色小视频在线观看| 亚洲欧美国产一区二区三区| 日韩视频中文| 久久手机免费观看| 国产精品久久中文| 最好看的中文字幕久久| 粉嫩一区二区三区在线观看| 一级黄色片播放| 亚洲国产毛片完整版| 亚洲午夜激情在线| 在线观看国产v片| 91精品国产乱码久久久久久久久 | 欧美一级二级三级蜜桃| 精品国产91乱码一区二区三区四区 | 日韩久久在线| 在线观看免费一区| 国产精品成人a在线观看| 爱草在线视频| 日韩av电影院| 亚洲精品一二三四区| 在线观看视频一区二区三区| 国产免费黄色小视频| 国产亚洲精品一区二555| 巨乳诱惑日韩免费av| 麻豆传媒视频在线观看| 久久艹中文字幕| 在线播放视频一区| 在线电影一区二区| 国产女主播在线直播| 国产精选一区二区| 欧美丰满美乳xxx高潮www| 欧美视频官网| 大片免费播放在线视频| 国产亚洲第一区| 日韩免费一区二区| 国产一本一道久久香蕉| 日本a人精品| 97影院理论片在线播放| 国产精品揄拍500视频| 欧美日韩国产中文字幕| 亚洲美女视频| 大地资源网3页在线观看| 少妇精品久久久久久久久久| 亚洲男女自偷自拍图片另类| 99亚偷拍自图区亚洲| 久久九九热re6这里有精品| 久久mv成人精品亚洲动漫| 国产在线视频91| 欧美一区二区视频在线观看| 另类综合日韩欧美亚洲| 国产成人福利夜色影视| 福利在线一区二区三区| 日本免费一区二区三区视频观看| 精品二区三区线观看| 国产视频欧美| 成人av集中营| 国产日韩精品视频一区二区三区 | 毛片免费不卡| 任我爽在线视频精品一| 精品国产一区二区亚洲人成毛片| 国产毛片一区二区| 警花av一区二区三区| 免费一级大片| 国产一区福利视频| 亚洲乱码国产乱码精品精| 国产欧美综合色| 亚洲精品成人| 三级在线观看视频| 亚洲综合日韩欧美| 亚洲一区二区三区久久| 日韩精品一区二区三区三区免费| 99久久99久久久精品齐齐| 精品国产一区一区二区三亚瑟| 亚洲乱亚洲乱妇| 免费观看国产精品视频| 国产精品久久久久国产a级| 日韩亚洲欧美高清| 91女厕偷拍女厕偷拍高清| 69av在线视频| 欧美二区在线播放| 欧美丰满少妇xxxbbb| 天堂成人免费av电影一区| 欧美成人三级| 亚洲精品一区视频| 免费成人进口网站| 国产精品精品久久久| 日韩精品中文字幕在线| 亚洲午夜激情网站| 国产精品1区2区3区在线观看| 欧美激情国产日韩| 久久精品成人动漫| 91久久线看在观草草青青| 国产精品一区二区三区网站| 日本一本不卡| 欧美午夜三级| 成人黄视频在线观看| 国产三级免费观看| 精品少妇人欧美激情在线观看|