codekingpro/portable-devtools
115k
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>CREATE SUBSCRIPTION</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="sql-createstatistics.html" title="CREATE STATISTICS" /><link rel="next" href="sql-createtable.html" title="CREATE TABLE" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">CREATE SUBSCRIPTION</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="sql-createstatistics.html" title="CREATE STATISTICS">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="sql-commands.html" title="SQL Commands">Up</a></td><th width="60%" align="center">SQL Commands</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 16.3 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="sql-createtable.html" title="CREATE TABLE">Next</a></td></tr></table><hr /></div><div class="refentry" id="SQL-CREATESUBSCRIPTION"><div class="titlepage"></div><a id="id-1.9.3.84.1" class="indexterm"></a><div class="refnamediv"><h2><span class="refentrytitle">CREATE SUBSCRIPTION</span></h2><p>CREATE SUBSCRIPTION — define a new subscription</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">3CREATE SUBSCRIPTION <em class="replaceable"><code>subscription_name</code></em>4 CONNECTION '<em class="replaceable"><code>conninfo</code></em>'5 PUBLICATION <em class="replaceable"><code>publication_name</code></em> [, ...]6 [ WITH ( <em class="replaceable"><code>subscription_parameter</code></em> [= <em class="replaceable"><code>value</code></em>] [, ... ] ) ]7</pre></div><div class="refsect1" id="id-1.9.3.84.5"><h2>Description</h2><p>8 <code class="command">CREATE SUBSCRIPTION</code> adds a new logical-replication9 subscription. The user that creates a subscription becomes the owner10 of the subscription. The subscription name must be distinct from the name of11 any existing subscription in the current database.12 </p><p>13 A subscription represents a replication connection to the publisher.14 Hence, in addition to adding definitions in the local catalogs, this15 command normally creates a replication slot on the publisher.16 </p><p>17 A logical replication worker will be started to replicate data for the new18 subscription at the commit of the transaction where this command is run,19 unless the subscription is initially disabled.20 </p><p>21 To be able to create a subscription, you must have the privileges of the22 the <code class="literal">pg_create_subscription</code> role, as well as23 <code class="literal">CREATE</code> privileges on the current database.24 </p><p>25 Additional information about subscriptions and logical replication as a26 whole is available at <a class="xref" href="logical-replication-subscription.html" title="31.2. Subscription">Section 31.2</a> and27 <a class="xref" href="logical-replication.html" title="Chapter 31. Logical Replication">Chapter 31</a>.28 </p></div><div class="refsect1" id="id-1.9.3.84.6"><h2>Parameters</h2><div class="variablelist"><dl class="variablelist"><dt id="SQL-CREATESUBSCRIPTION-NAME"><span class="term"><em class="replaceable"><code>subscription_name</code></em></span> <a href="#SQL-CREATESUBSCRIPTION-NAME" class="id_link">#</a></dt><dd><p>29 The name of the new subscription.30 </p></dd><dt id="SQL-CREATESUBSCRIPTION-CONNECTION"><span class="term"><code class="literal">CONNECTION '<em class="replaceable"><code>conninfo</code></em>'</code></span> <a href="#SQL-CREATESUBSCRIPTION-CONNECTION" class="id_link">#</a></dt><dd><p>31 The <span class="application">libpq</span> connection string defining how32 to connect to the publisher database. For details see33 <a class="xref" href="libpq-connect.html#LIBPQ-CONNSTRING" title="34.1.1. Connection Strings">Section 34.1.1</a>.34 </p></dd><dt id="SQL-CREATESUBSCRIPTION-PUBLICATION"><span class="term"><code class="literal">PUBLICATION <em class="replaceable"><code>publication_name</code></em> [, ...]</code></span> <a href="#SQL-CREATESUBSCRIPTION-PUBLICATION" class="id_link">#</a></dt><dd><p>35 Names of the publications on the publisher to subscribe to.36 </p></dd><dt id="SQL-CREATESUBSCRIPTION-WITH"><span class="term"><code class="literal">WITH ( <em class="replaceable"><code>subscription_parameter</code></em> [= <em class="replaceable"><code>value</code></em>] [, ... ] )</code></span> <a href="#SQL-CREATESUBSCRIPTION-WITH" class="id_link">#</a></dt><dd><p>37 This clause specifies optional parameters for a subscription.38 </p><p>39 The following parameters control what happens during subscription creation:40 41 </p><div class="variablelist"><dl class="variablelist"><dt id="SQL-CREATESUBSCRIPTION-WITH-CONNECT"><span class="term"><code class="literal">connect</code> (<code class="type">boolean</code>)</span> <a href="#SQL-CREATESUBSCRIPTION-WITH-CONNECT" class="id_link">#</a></dt><dd><p>42 Specifies whether the <code class="command">CREATE SUBSCRIPTION</code>43 command should connect to the publisher at all. The default44 is <code class="literal">true</code>. Setting this to45 <code class="literal">false</code> will force the values of46 <code class="literal">create_slot</code>, <code class="literal">enabled</code> and47 <code class="literal">copy_data</code> to <code class="literal">false</code>.48 (You cannot combine setting <code class="literal">connect</code>49 to <code class="literal">false</code> with50 setting <code class="literal">create_slot</code>, <code class="literal">enabled</code>,51 or <code class="literal">copy_data</code> to <code class="literal">true</code>.)52 </p><p>53 Since no connection is made when this option is54 <code class="literal">false</code>, no tables are subscribed. To initiate55 replication, you must manually create the replication slot, enable56 the subscription, and refresh the subscription. See57 <a class="xref" href="logical-replication-subscription.html#LOGICAL-REPLICATION-SUBSCRIPTION-EXAMPLES-DEFERRED-SLOT" title="31.2.3. Examples: Deferred Replication Slot Creation">Section 31.2.3</a>58 for examples.59 </p></dd><dt id="SQL-CREATESUBSCRIPTION-WITH-CREATE-SLOT"><span class="term"><code class="literal">create_slot</code> (<code class="type">boolean</code>)</span> <a href="#SQL-CREATESUBSCRIPTION-WITH-CREATE-SLOT" class="id_link">#</a></dt><dd><p>60 Specifies whether the command should create the replication slot on61 the publisher. The default is <code class="literal">true</code>.62 </p><p>63 If set to <code class="literal">false</code>, you are responsible for64 creating the publisher's slot in some other way. See65 <a class="xref" href="logical-replication-subscription.html#LOGICAL-REPLICATION-SUBSCRIPTION-EXAMPLES-DEFERRED-SLOT" title="31.2.3. Examples: Deferred Replication Slot Creation">Section 31.2.3</a>66 for examples.67 </p></dd><dt id="SQL-CREATESUBSCRIPTION-WITH-ENABLED"><span class="term"><code class="literal">enabled</code> (<code class="type">boolean</code>)</span> <a href="#SQL-CREATESUBSCRIPTION-WITH-ENABLED" class="id_link">#</a></dt><dd><p>68 Specifies whether the subscription should be actively replicating69 or whether it should just be set up but not started yet. The default70 is <code class="literal">true</code>.71 </p></dd><dt id="SQL-CREATESUBSCRIPTION-WITH-SLOT-NAME"><span class="term"><code class="literal">slot_name</code> (<code class="type">string</code>)</span> <a href="#SQL-CREATESUBSCRIPTION-WITH-SLOT-NAME" class="id_link">#</a></dt><dd><p>72 Name of the publisher's replication slot to use. The default is73 to use the name of the subscription for the slot name.74 </p><p>75 Setting <code class="literal">slot_name</code> to <code class="literal">NONE</code>76 means there will be no replication slot associated with the77 subscription. Such subscriptions must also have both78 <code class="literal">enabled</code> and <code class="literal">create_slot</code> set to79 <code class="literal">false</code>. Use this when you will be creating the80 replication slot later manually. See81 <a class="xref" href="logical-replication-subscription.html#LOGICAL-REPLICATION-SUBSCRIPTION-EXAMPLES-DEFERRED-SLOT" title="31.2.3. Examples: Deferred Replication Slot Creation">Section 31.2.3</a>82 for examples.83 </p></dd></dl></div><p>84 </p><p>85 The following parameters control the subscription's replication86 behavior after it has been created:87 88 </p><div class="variablelist"><dl class="variablelist"><dt id="SQL-CREATESUBSCRIPTION-WITH-BINARY"><span class="term"><code class="literal">binary</code> (<code class="type">boolean</code>)</span> <a href="#SQL-CREATESUBSCRIPTION-WITH-BINARY" class="id_link">#</a></dt><dd><p>89 Specifies whether the subscription will request the publisher to send90 the data in binary format (as opposed to text). The default is91 <code class="literal">false</code>. Any initial table synchronization copy92 (see <code class="literal">copy_data</code>) also uses the same format. Binary93 format can be faster than the text format, but it is less portable94 across machine architectures and <span class="productname">PostgreSQL</span>95 versions. Binary format is very data type specific; for example, it96 will not allow copying from a <code class="type">smallint</code> column to an97 <code class="type">integer</code> column, even though that would work fine in text98 format. Even when this option is enabled, only data types having binary99 send and receive functions will be transferred in binary. Note that100 the initial synchronization requires all data types to have binary101 send and receive functions, otherwise the synchronization will fail102 (see <a class="xref" href="sql-createtype.html" title="CREATE TYPE"><span class="refentrytitle">CREATE TYPE</span></a> for more about send/receive103 functions).104 </p><p>105 When doing cross-version replication, it could be that the106 publisher has a binary send function for some data type, but the107 subscriber lacks a binary receive function for that type. In108 such a case, data transfer will fail, and109 the <code class="literal">binary</code> option cannot be used.110 </p><p>111 If the publisher is a <span class="productname">PostgreSQL</span> version112 before 16, then any initial table synchronization will use text format113 even if <code class="literal">binary = true</code>.114 </p></dd><dt id="SQL-CREATESUBSCRIPTION-WITH-COPY-DATA"><span class="term"><code class="literal">copy_data</code> (<code class="type">boolean</code>)</span> <a href="#SQL-CREATESUBSCRIPTION-WITH-COPY-DATA" class="id_link">#</a></dt><dd><p>115 Specifies whether to copy pre-existing data in the publications116 that are being subscribed to when the replication starts.117 The default is <code class="literal">true</code>.118 </p><p>119 If the publications contain <code class="literal">WHERE</code> clauses, it120 will affect what data is copied. Refer to the121 <a class="xref" href="sql-createsubscription.html#SQL-CREATESUBSCRIPTION-NOTES" title="Notes">Notes</a> for details.122 </p><p>123 See <a class="xref" href="sql-createsubscription.html#SQL-CREATESUBSCRIPTION-NOTES" title="Notes">Notes</a> for details of how124 <code class="literal">copy_data = true</code> can interact with the125 <code class="literal">origin</code> parameter.126 </p></dd><dt id="SQL-CREATESUBSCRIPTION-WITH-STREAMING"><span class="term"><code class="literal">streaming</code> (<code class="type">enum</code>)</span> <a href="#SQL-CREATESUBSCRIPTION-WITH-STREAMING" class="id_link">#</a></dt><dd><p>127 Specifies whether to enable streaming of in-progress transactions128 for this subscription. The default value is <code class="literal">off</code>,129 meaning all transactions are fully decoded on the publisher and only130 then sent to the subscriber as a whole.131 </p><p>132 If set to <code class="literal">on</code>, the incoming changes are written to133 temporary files and then applied only after the transaction is134 committed on the publisher and received by the subscriber.135 </p><p>136 If set to <code class="literal">parallel</code>, incoming changes are directly137 applied via one of the parallel apply workers, if available. If no138 parallel apply worker is free to handle streaming transactions then139 the changes are written to temporary files and applied after the140 transaction is committed. Note that if an error happens in a141 parallel apply worker, the finish LSN of the remote transaction142 might not be reported in the server log.143 </p></dd><dt id="SQL-CREATESUBSCRIPTION-WITH-SYNCHRONOUS-COMMIT"><span class="term"><code class="literal">synchronous_commit</code> (<code class="type">enum</code>)</span> <a href="#SQL-CREATESUBSCRIPTION-WITH-SYNCHRONOUS-COMMIT" class="id_link">#</a></dt><dd><p>144 The value of this parameter overrides the145 <a class="xref" href="runtime-config-wal.html#GUC-SYNCHRONOUS-COMMIT">synchronous_commit</a> setting within this146 subscription's apply worker processes. The default value147 is <code class="literal">off</code>.148 </p><p>149 It is safe to use <code class="literal">off</code> for logical replication:150 If the subscriber loses transactions because of missing151 synchronization, the data will be sent again from the publisher.152 </p><p>153 A different setting might be appropriate when doing synchronous154 logical replication. The logical replication workers report the155 positions of writes and flushes to the publisher, and when using156 synchronous replication, the publisher will wait for the actual157 flush. This means that setting158 <code class="literal">synchronous_commit</code> for the subscriber to159 <code class="literal">off</code> when the subscription is used for160 synchronous replication might increase the latency for161 <code class="command">COMMIT</code> on the publisher. In this scenario, it162 can be advantageous to set <code class="literal">synchronous_commit</code>163 to <code class="literal">local</code> or higher.164 </p></dd><dt id="SQL-CREATESUBSCRIPTION-WITH-TWO-PHASE"><span class="term"><code class="literal">two_phase</code> (<code class="type">boolean</code>)</span> <a href="#SQL-CREATESUBSCRIPTION-WITH-TWO-PHASE" class="id_link">#</a></dt><dd><p>165 Specifies whether two-phase commit is enabled for this subscription.166 The default is <code class="literal">false</code>.167 </p><p>168 When two-phase commit is enabled, prepared transactions are sent169 to the subscriber at the time of <code class="command">PREPARE170 TRANSACTION</code>, and are processed as two-phase171 transactions on the subscriber too. Otherwise, prepared172 transactions are sent to the subscriber only when committed, and173 are then processed immediately by the subscriber.174 </p><p>175 The implementation of two-phase commit requires that replication176 has successfully finished the initial table synchronization177 phase. So even when <code class="literal">two_phase</code> is enabled for a178 subscription, the internal two-phase state remains179 temporarily <span class="quote">“<span class="quote">pending</span>”</span> until the initialization phase180 completes. See column <code class="structfield">subtwophasestate</code>181 of <a class="link" href="catalog-pg-subscription.html" title="53.54. pg_subscription"><code class="structname">pg_subscription</code></a>182 to know the actual two-phase state.183 </p></dd><dt id="SQL-CREATESUBSCRIPTION-WITH-DISABLE-ON-ERROR"><span class="term"><code class="literal">disable_on_error</code> (<code class="type">boolean</code>)</span> <a href="#SQL-CREATESUBSCRIPTION-WITH-DISABLE-ON-ERROR" class="id_link">#</a></dt><dd><p>184 Specifies whether the subscription should be automatically disabled185 if any errors are detected by subscription workers during data186 replication from the publisher. The default is187 <code class="literal">false</code>.188 </p></dd><dt id="SQL-CREATESUBSCRIPTION-WITH-PASSWORD-REQUIRED"><span class="term"><code class="literal">password_required</code> (<code class="type">boolean</code>)</span> <a href="#SQL-CREATESUBSCRIPTION-WITH-PASSWORD-REQUIRED" class="id_link">#</a></dt><dd><p>189 If set to <code class="literal">true</code>, connections to the publisher made190 as a result of this subscription must use password authentication191 and the password must be specified as a part of the connection192 string. This setting is ignored when the subscription is owned by a193 superuser. The default is <code class="literal">true</code>. Only superusers194 can set this value to <code class="literal">false</code>.195 </p></dd><dt id="SQL-CREATESUBSCRIPTION-WITH-RUN-AS-OWNER"><span class="term"><code class="literal">run_as_owner</code> (<code class="type">boolean</code>)</span> <a href="#SQL-CREATESUBSCRIPTION-WITH-RUN-AS-OWNER" class="id_link">#</a></dt><dd><p>196 If true, all replication actions are performed as the subscription197 owner. If false, replication workers will perform actions on each198 table as the owner of that table. The latter configuration is199 generally much more secure; for details, see200 <a class="xref" href="logical-replication-security.html" title="31.9. Security">Section 31.9</a>.201 The default is <code class="literal">false</code>.202 </p></dd><dt id="SQL-CREATESUBSCRIPTION-WITH-ORIGIN"><span class="term"><code class="literal">origin</code> (<code class="type">string</code>)</span> <a href="#SQL-CREATESUBSCRIPTION-WITH-ORIGIN" class="id_link">#</a></dt><dd><p>203 Specifies whether the subscription will request the publisher to only204 send changes that don't have an origin or send changes regardless of205 origin. Setting <code class="literal">origin</code> to <code class="literal">none</code>206 means that the subscription will request the publisher to only send207 changes that don't have an origin. Setting <code class="literal">origin</code>208 to <code class="literal">any</code> means that the publisher sends changes209 regardless of their origin. The default is <code class="literal">any</code>.210 </p><p>211 See <a class="xref" href="sql-createsubscription.html#SQL-CREATESUBSCRIPTION-NOTES" title="Notes">Notes</a> for details of how212 <code class="literal">copy_data = true</code> can interact with the213 <code class="literal">origin</code> parameter.214 </p></dd></dl></div></dd></dl></div><p>215 When specifying a parameter of type <code class="type">boolean</code>, the216 <code class="literal">=</code> <em class="replaceable"><code>value</code></em>217 part can be omitted, which is equivalent to218 specifying <code class="literal">TRUE</code>.219 </p></div><div class="refsect1" id="SQL-CREATESUBSCRIPTION-NOTES"><h2>Notes</h2><p>220 See <a class="xref" href="logical-replication-security.html" title="31.9. Security">Section 31.9</a> for details on221 how to configure access control between the subscription and the222 publication instance.223 </p><p>224 When creating a replication slot (the default behavior), <code class="command">CREATE225 SUBSCRIPTION</code> cannot be executed inside a transaction block.226 </p><p>227 Creating a subscription that connects to the same database cluster (for228 example, to replicate between databases in the same cluster or to replicate229 within the same database) will only succeed if the replication slot is not230 created as part of the same command. Otherwise, the <code class="command">CREATE231 SUBSCRIPTION</code> call will hang. To make this work, create the232 replication slot separately (using the233 function <code class="function">pg_create_logical_replication_slot</code> with the234 plugin name <code class="literal">pgoutput</code>) and create the subscription using235 the parameter <code class="literal">create_slot = false</code>. See236 <a class="xref" href="logical-replication-subscription.html#LOGICAL-REPLICATION-SUBSCRIPTION-EXAMPLES-DEFERRED-SLOT" title="31.2.3. Examples: Deferred Replication Slot Creation">Section 31.2.3</a>237 for examples. This is an implementation restriction that might be lifted in a238 future release.239 </p><p>240 If any table in the publication has a <code class="literal">WHERE</code> clause, rows241 for which the <em class="replaceable"><code>expression</code></em>242 evaluates to false or null will not be published. If the subscription has243 several publications in which the same table has been published with244 different <code class="literal">WHERE</code> clauses, a row will be published if any245 of the expressions (referring to that publish operation) are satisfied. In246 the case of different <code class="literal">WHERE</code> clauses, if one of the247 publications has no <code class="literal">WHERE</code> clause (referring to that248 publish operation) or the publication is declared as249 <a class="link" href="sql-createpublication.html#SQL-CREATEPUBLICATION-FOR-ALL-TABLES"><code class="literal">FOR ALL TABLES</code></a>250 or <a class="link" href="sql-createpublication.html#SQL-CREATEPUBLICATION-FOR-TABLES-IN-SCHEMA"><code class="literal">FOR TABLES IN SCHEMA</code></a>,251 rows are always published regardless of the definition of the other252 expressions. If the subscriber is a <span class="productname">PostgreSQL</span>253 version before 15, then any row filtering is ignored during the initial data254 synchronization phase. For this case, the user might want to consider255 deleting any initially copied data that would be incompatible with256 subsequent filtering. Because initial data synchronization does not take257 into account the publication258 <a class="link" href="sql-createpublication.html#SQL-CREATEPUBLICATION-WITH-PUBLISH"><code class="literal">publish</code></a>259 parameter when copying existing table data, some rows may be copied that260 would not be replicated using DML. See261 <a class="xref" href="logical-replication-subscription.html#LOGICAL-REPLICATION-SUBSCRIPTION-EXAMPLES" title="31.2.2. Examples: Set Up Logical Replication">Section 31.2.2</a> for examples.262 </p><p>263 Subscriptions having several publications in which the same table has been264 published with different column lists are not supported.265 </p><p>266 We allow non-existent publications to be specified so that users can add267 those later. This means268 <a class="link" href="catalog-pg-subscription.html" title="53.54. pg_subscription"><code class="structname">pg_subscription</code></a>269 can have non-existent publications.270 </p><p>271 When using a subscription parameter combination of272 <code class="literal">copy_data = true</code> and <code class="literal">origin = NONE</code>,273 the initial sync table data is copied directly from the publisher, meaning274 that knowledge of the true origin of that data is not possible. If the275 publisher also has subscriptions then the copied table data might have276 originated from further upstream. This scenario is detected and a WARNING is277 logged to the user, but the warning is only an indication of a potential278 problem; it is the user's responsibility to make the necessary checks to279 ensure the copied data origins are really as wanted or not.280 </p><p>281 To find which tables might potentially include non-local origins (due to282 other subscriptions created on the publisher) try this SQL query:283</p><pre class="programlisting">284# substitute <pub-names> below with your publication name(s) to be queried285SELECT DISTINCT PT.schemaname, PT.tablename286FROM pg_publication_tables PT,287 pg_subscription_rel PS288 JOIN pg_class C ON (C.oid = PS.srrelid)289 JOIN pg_namespace N ON (N.oid = C.relnamespace)290WHERE N.nspname = PT.schemaname AND291 C.relname = PT.tablename AND292 PT.pubname IN (<pub-names>);293</pre></div><div class="refsect1" id="id-1.9.3.84.8"><h2>Examples</h2><p>294 Create a subscription to a remote server that replicates tables in295 the publications <code class="literal">mypublication</code> and296 <code class="literal">insert_only</code> and starts replicating immediately on297 commit:298</p><pre class="programlisting">299CREATE SUBSCRIPTION mysub300 CONNECTION 'host=192.168.1.50 port=5432 user=foo dbname=foodb'301 PUBLICATION mypublication, insert_only;302</pre><p>303 </p><p>304 Create a subscription to a remote server that replicates tables in305 the <code class="literal">insert_only</code> publication and does not start replicating306 until enabled at a later time.307</p><pre class="programlisting">308CREATE SUBSCRIPTION mysub309 CONNECTION 'host=192.168.1.50 port=5432 user=foo dbname=foodb'310 PUBLICATION insert_only311 WITH (enabled = false);312</pre></div><div class="refsect1" id="id-1.9.3.84.9"><h2>Compatibility</h2><p>313 <code class="command">CREATE SUBSCRIPTION</code> is a <span class="productname">PostgreSQL</span>314 extension.315 </p></div><div class="refsect1" id="id-1.9.3.84.10"><h2>See Also</h2><span class="simplelist"><a class="xref" href="sql-altersubscription.html" title="ALTER SUBSCRIPTION"><span class="refentrytitle">ALTER SUBSCRIPTION</span></a>, <a class="xref" href="sql-dropsubscription.html" title="DROP SUBSCRIPTION"><span class="refentrytitle">DROP SUBSCRIPTION</span></a>, <a class="xref" href="sql-createpublication.html" title="CREATE PUBLICATION"><span class="refentrytitle">CREATE PUBLICATION</span></a>, <a class="xref" href="sql-alterpublication.html" title="ALTER PUBLICATION"><span class="refentrytitle">ALTER PUBLICATION</span></a></span></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="sql-createstatistics.html" title="CREATE STATISTICS">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="sql-commands.html" title="SQL Commands">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="sql-createtable.html" title="CREATE TABLE">Next</a></td></tr><tr><td width="40%" align="left" valign="top">CREATE STATISTICS </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 16.3 Documentation">Home</a></td><td width="40%" align="right" valign="top"> CREATE TABLE</td></tr></table></div></body></html>