# 49.1.
逻辑解码示例
以下示例演示了使用 SQL 接口控制逻辑解码。在您可以使用逻辑解码之前,您必须设置沃尔_等级到
合乎逻辑的和最大限度_复制_插槽至少为 1.然后,您应该连接到目标数据库(在下面的示例中,postgres
) 作为超级用户。
postgres=# -- Create a slot named 'regression_slot' using the output plugin 'test_decoding'
postgres=# SELECT * FROM pg_create_logical_replication_slot('regression_slot', 'test_decoding', false, true);
slot_name | lsn