* Logical replication protocol message dispatcher. */
| 1997 | * Logical replication protocol message dispatcher. |
| 1998 | */ |
| 1999 | static void |
| 2000 | apply_dispatch(StringInfo s) |
| 2001 | { |
| 2002 | LogicalRepMsgType action = pq_getmsgbyte(s); |
| 2003 | |
| 2004 | switch (action) |
| 2005 | { |
| 2006 | case LOGICAL_REP_MSG_BEGIN: |
| 2007 | apply_handle_begin(s); |
| 2008 | return; |
| 2009 | |
| 2010 | case LOGICAL_REP_MSG_COMMIT: |
| 2011 | apply_handle_commit(s); |
| 2012 | return; |
| 2013 | |
| 2014 | case LOGICAL_REP_MSG_INSERT: |
| 2015 | apply_handle_insert(s); |
| 2016 | return; |
| 2017 | |
| 2018 | case LOGICAL_REP_MSG_UPDATE: |
| 2019 | apply_handle_update(s); |
| 2020 | return; |
| 2021 | |
| 2022 | case LOGICAL_REP_MSG_DELETE: |
| 2023 | apply_handle_delete(s); |
| 2024 | return; |
| 2025 | |
| 2026 | case LOGICAL_REP_MSG_TRUNCATE: |
| 2027 | apply_handle_truncate(s); |
| 2028 | return; |
| 2029 | |
| 2030 | case LOGICAL_REP_MSG_RELATION: |
| 2031 | apply_handle_relation(s); |
| 2032 | return; |
| 2033 | |
| 2034 | case LOGICAL_REP_MSG_TYPE: |
| 2035 | apply_handle_type(s); |
| 2036 | return; |
| 2037 | |
| 2038 | case LOGICAL_REP_MSG_ORIGIN: |
| 2039 | apply_handle_origin(s); |
| 2040 | return; |
| 2041 | |
| 2042 | case LOGICAL_REP_MSG_MESSAGE: |
| 2043 | |
| 2044 | /* |
| 2045 | * Logical replication does not use generic logical messages yet. |
| 2046 | * Although, it could be used by other applications that use this |
| 2047 | * output plugin. |
| 2048 | */ |
| 2049 | return; |
| 2050 | |
| 2051 | case LOGICAL_REP_MSG_STREAM_START: |
| 2052 | apply_handle_stream_start(s); |
| 2053 | return; |
| 2054 | |
| 2055 | case LOGICAL_REP_MSG_STREAM_END: |
| 2056 | apply_handle_stream_stop(s); |
no test coverage detected