Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5y4L-0000aV-7Z for pgsql-hackers@arkaria.postgresql.org; Wed, 03 May 2017 17:28:05 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d5y4J-0001GS-5H for pgsql-hackers@arkaria.postgresql.org; Wed, 03 May 2017 17:28:03 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d5y4H-0001Fz-99 for pgsql-hackers@postgresql.org; Wed, 03 May 2017 17:28:01 +0000 Received: from mail-qt0-x22c.google.com ([2607:f8b0:400d:c0d::22c]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1d5y4E-0002jX-7L for pgsql-hackers@postgresql.org; Wed, 03 May 2017 17:28:00 +0000 Received: by mail-qt0-x22c.google.com with SMTP id c45so143388887qtb.1 for ; Wed, 03 May 2017 10:27:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=FZRBRZFwAzOk7RVZF15MNKcYWGaDKo2SidVSarUJpNM=; b=l5uvEn3MCkw7t0P8COnHg9g3czhDKQaGfHTBNMeyHeLRCwC7Ql9PhhSbBzoCjDSiDI w4hH6ab2dthWB3GFRQx46nEkI5JRQTbloabKzwlByfhKbhbOKcHuRbX5gaisJhPjBoyx mQEUXwu+fO37szPAunrUi4vDpRaI3UPa4U9mlW2Rg2Ap7neRCXs2PgMD0UsWbXz0YF8m 1xprzGG4DwM9vCYN1mFb+FLmys5svb3KrpuY3cxVcH8X5S8ogNw29/MppyKWq+HRE23T g6WwuJ3DgqKT6H89qcNIGvuOuX06jLMSOqbd5/94mTagfwu2CT10H5KbNNJyXRdTBzfj sVdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=FZRBRZFwAzOk7RVZF15MNKcYWGaDKo2SidVSarUJpNM=; b=DPGY9zTuu5B+psCYe7gzWk29/5Nl+YjJZ7R/Bh1z4wERc3CZ9Ka6u29DiWOcA6IwI1 cwNWA2+XidIWVlwBbE4CDGHPd3fMoPW6wXRh0jdBEL+y56pfL1oR6DOvH/pgRk2Uv/Ma x6xauxhSQa7JvSooYMVKfHm4kpjpNeGjgfTBLgrFzVeB6/oVqG3E1AA5bubVPK2UPHxi y78/90hgkAKFbdwQeY1KsgBgFghzR+KRbULkCBTU266AcxEdWsm+7o+r0lmlUu8D3zq/ pMs8wXRcmE8kI85Hrgsr1RiGp9MhPUvF37SlT6iEO5OW7PylL+eJhkaTK7WYIdmXr+uT EuAA== X-Gm-Message-State: AN3rC/7iaUACPnqghj7q/i3y1Cyi4BYnoOO6WhSIQWLrXCEeNWlJtDPP oZGPase1j/J4iBmp X-Received: by 10.200.46.26 with SMTP id r26mr35375036qta.197.1493832476604; Wed, 03 May 2017 10:27:56 -0700 (PDT) Received: from alvin.alvh.no-ip.org ([190.217.209.130]) by smtp.gmail.com with ESMTPSA id u49sm16306054qte.44.2017.05.03.10.27.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 May 2017 10:27:55 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id BB6FB3B8; Wed, 3 May 2017 14:27:46 -0300 (-03) Date: Wed, 3 May 2017 14:27:46 -0300 From: Alvaro Herrera To: Simon Riggs Cc: Tomas Vondra , PostgreSQL-development , Stephen Frost Subject: Re: WITH clause in CREATE STATISTICS Message-ID: <20170503172746.rwftidszir67sgk7@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="id4hmnc3jkz2dgwa" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20170503151801.4u46436mc64r2bfa@alvherre.pgsql> User-Agent: NeoMutt/20170306-137-4415bd-dirty (1.8.0) X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org --id4hmnc3jkz2dgwa Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit Alvaro Herrera wrote: > In the meantime, I noticed that pg_dump support for extstats is not > covered, which I'll go fix next. Here I add one, which seems to work for me. Considering that Stephen missed a terminating semicolon for test with create_order 96 (the last one prior to my commit) in commit 31a8b77a9244, I propose that we change whatever is concatenating those strings append a terminating semicolon. (Surely we don't care about two tests stanzas writing a single SQL command by omitting the semicolon terminator.) I wonder if there's any rationale to the create_order numbers. Surely we only care for objects that depend on others. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services --id4hmnc3jkz2dgwa Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="0001-Add-pg_dump-tests-for-CREATE-STATISTICS.patch" From 1dcb16de656d48c1004d4f4a12475438618a5c72 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Wed, 3 May 2017 14:18:22 -0300 Subject: [PATCH] Add pg_dump tests for CREATE STATISTICS --- src/bin/pg_dump/t/002_pg_dump.pl | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/src/bin/pg_dump/t/002_pg_dump.pl b/src/bin/pg_dump/t/002_pg_dump.pl index ccd0ed6a53..79108cd331 100644 --- a/src/bin/pg_dump/t/002_pg_dump.pl +++ b/src/bin/pg_dump/t/002_pg_dump.pl @@ -1053,7 +1053,7 @@ my %tests = ( all_runs => 1, catch_all => 'ALTER TABLE ... commands', create_order => 96, - create_sql => 'ALTER TABLE dump_test.test_table CLUSTER ON test_table_pkey', + create_sql => 'ALTER TABLE dump_test.test_table CLUSTER ON test_table_pkey;', regexp => qr/^ \QALTER TABLE test_table CLUSTER ON test_table_pkey;\E\n /xm, @@ -4920,6 +4920,40 @@ qr/CREATE TRANSFORM FOR integer LANGUAGE sql \(FROM SQL WITH FUNCTION pg_catalog role => 1, section_post_data => 1, }, }, + 'CREATE STATISTICS extended_stats_no_using' => { + all_runs => 1, + catch_all => 'CREATE ... commands', + create_order => 97, + create_sql => 'CREATE STATISTICS dump_test.test_ext_stats_no_using + ON (col1, col2) FROM dump_test.test_fifth_table;', + regexp => qr/^ + \QCREATE STATISTICS dump_test.test_ext_stats_no_using ON (col1, col2) FROM test_fifth_table;\E + /xms, + like => { + binary_upgrade => 1, + clean => 1, + clean_if_exists => 1, + createdb => 1, + defaults => 1, + exclude_test_table => 1, + exclude_test_table_data => 1, + no_blobs => 1, + no_privs => 1, + no_owner => 1, + only_dump_test_schema => 1, + pg_dumpall_dbprivs => 1, + schema_only => 1, + section_post_data => 1, + test_schema_plus_blobs => 1, + with_oids => 1, }, + unlike => { + exclude_dump_test_schema => 1, + only_dump_test_table => 1, + pg_dumpall_globals => 1, + pg_dumpall_globals_clean => 1, + role => 1, + section_pre_data => 1, }, }, + 'CREATE SEQUENCE test_table_col1_seq' => { all_runs => 1, catch_all => 'CREATE ... commands', -- 2.11.0 --id4hmnc3jkz2dgwa Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --id4hmnc3jkz2dgwa--