You can subscribe to this list here.
2010 |
Jan
|
Feb
|
Mar
|
Apr
(4) |
May
(28) |
Jun
(12) |
Jul
(11) |
Aug
(12) |
Sep
(5) |
Oct
(19) |
Nov
(14) |
Dec
(12) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2011 |
Jan
(18) |
Feb
(30) |
Mar
(115) |
Apr
(89) |
May
(50) |
Jun
(44) |
Jul
(22) |
Aug
(13) |
Sep
(11) |
Oct
(30) |
Nov
(28) |
Dec
(39) |
2012 |
Jan
(38) |
Feb
(18) |
Mar
(43) |
Apr
(91) |
May
(108) |
Jun
(46) |
Jul
(37) |
Aug
(44) |
Sep
(33) |
Oct
(29) |
Nov
(36) |
Dec
(15) |
2013 |
Jan
(35) |
Feb
(611) |
Mar
(5) |
Apr
(55) |
May
(30) |
Jun
(28) |
Jul
(458) |
Aug
(34) |
Sep
(9) |
Oct
(39) |
Nov
(22) |
Dec
(32) |
2014 |
Jan
(16) |
Feb
(16) |
Mar
(42) |
Apr
(179) |
May
(7) |
Jun
(6) |
Jul
(9) |
Aug
|
Sep
(4) |
Oct
|
Nov
(3) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
|
|
|
1
(2) |
2
(3) |
3
|
4
(2) |
5
(3) |
6
(2) |
7
(8) |
8
(12) |
9
|
10
|
11
(17) |
12
(16) |
13
(4) |
14
(3) |
15
(5) |
16
|
17
|
18
(1) |
19
(3) |
20
(2) |
21
(1) |
22
(1) |
23
|
24
|
25
(3) |
26
(1) |
27
|
28
|
29
|
30
|
From: Michael P. <mic...@us...> - 2011-04-12 06:22:22
|
Project "website". The branch, master has been updated via 0d458b46802e6e5e9035b37672dffe5a609a81c9 (commit) from 73afa8b8e55f695a042f4449334d839bf1b9ecfe (commit) - Log ----------------------------------------------------------------- commit 0d458b46802e6e5e9035b37672dffe5a609a81c9 Author: Michael P <mic...@us...> Date: Tue Apr 12 15:19:00 2011 +0900 Typo correction diff --git a/roadmap.html b/roadmap.html index 525f005..3ab431d 100755 --- a/roadmap.html +++ b/roadmap.html @@ -85,7 +85,7 @@ subqueries<br> <!-- ==== For Version 1.0 ==== --> <h4> -Version 0.9.5 (March, 2011) +Version 0.9.5 (June, 2011) </h4> <p class="inner"> ----------------------------------------------------------------------- Summary of changes: roadmap.html | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) hooks/post-receive -- website |
From: Michael P. <mic...@us...> - 2011-04-12 06:18:59
|
Project "website". The branch, master has been updated via 73afa8b8e55f695a042f4449334d839bf1b9ecfe (commit) from 6180d077309d20675daf8ba1101d173a18724baa (commit) - Log ----------------------------------------------------------------- commit 73afa8b8e55f695a042f4449334d839bf1b9ecfe Author: Michael P <mic...@us...> Date: Tue Apr 12 15:15:07 2011 +0900 Update of website coming with 0.9.4 diff --git a/download.html b/download.html index 9e1a297..bc83d13 100755 --- a/download.html +++ b/download.html @@ -36,34 +36,20 @@ the project download page. Please also note tarball files do not include Postgres-XC documents. </p> -<!-- Documents of version 0.9.2 --> +<!-- Documents of version 0.9.4 --> <h4> -Version 0.9.3 +Version 0.9.4 </h4> <p> <ul> -<!-- tarball of 0.9.3, main download--> +<!-- tarball of 0.9.4, main download--> <li> -<code>pgxc_v0.9.3.tar.gz</code>: <br> +<code>pgxc_v0.9.4.tar.gz</code>: <br> Latest version of Postgres-XC available.<br> Please note that Postgres-XC documentation is not included in this file. ⇒ -<a href="https://sourceforge.net/projects/postgres-xc/files/Version_0.9.3/pgxc_v0_9_3.tar.gz/download" target="_blank"> -(download) -</a> -</li> - -<!-- tarball (diff) --> -<li> -<code>PGXC_v0_9_3-PG_REL8_4_3.patch.gz</code>: <br> -The same material as above, but this file includes only the patch to apply -to the PostgreSQL 8.4.3 release source code.<br> -It is useful if you would like to see just a difference between PostgreSQL -and Postgres-XC.<br> -No Postgres-XC documentation is included in this file either. -⇒ -<a href="https://sourceforge.net/projects/postgres-xc/files/Version_0.9.3/PGXC_v0_9_3-PG_REL8_4_3.patch.gz/download" target="_blank"> +<a href="https://sourceforge.net/projects/postgres-xc/files/Version_0.9.4/pgxc_v0_9_4.tar.gz/download" target="_blank"> (download) </a> </li> @@ -73,7 +59,7 @@ No Postgres-XC documentation is included in this file either. <code>COPYING</code>: <br> License description. Postgres-XC is distributed under LGPL version 2.1 ⇒ -<a href="https://sourceforge.net/projects/postgres-xc/files/Version_0.9.3/COPYING/download" target="_blank"> +<a href="https://sourceforge.net/projects/postgres-xc/files/Version_0.9.4/COPYING/download" target="_blank"> (download) </a> </li> @@ -81,89 +67,61 @@ License description. Postgres-XC is distributed under LGPL version 2.1 <!-- Files --> <li> <code>FILES</code>: <br> -Description of files included in Postgres-XC 0.9.3 release. +Description of files included in Postgres-XC 0.9.4 release. ⇒ -<a href="https://sourceforge.net/projects/postgres-xc/files/Version_0.9.3/FILES/download" target="_blank"> +<a href="https://sourceforge.net/projects/postgres-xc/files/Version_0.9.4/FILES/download" target="_blank"> (download) </a> </li> <!-- Reference Manual --> <li> -<code>PG-XC_ReferenceManual_v0_9_3.pdf</code>: <br> +<code>PG-XC_ReferenceManual_v0_9_4.pdf</code>: <br> Reference of Postgres-XC extension. ⇒ -<a href="https://sourceforge.net/projects/postgres-xc/files/Version_0.9.3/PG-XC_ReferenceManual_v0_9_3.pdf/download" target="_blank"> +<a href="https://sourceforge.net/projects/postgres-xc/files/Version_0.9.4/PG-XC_ReferenceManual_v0_9_4.pdf/download" target="_blank"> (download) </a> </li> <!-- pgbench Tutorial Manual --> <li> -<code>PG-XC_pgbench_Tutorial_v0_9_3.pdf</code>: <br> +<code>PG-XC_pgbench_Tutorial_v0_9_4.pdf</code>: <br> Step by step description how to build and configure pgbench to run with Postgres-XC. ⇒ -<a href="https://sourceforge.net/projects/postgres-xc/files/Version_0.9.3/PG-XC_pgbench_Tutorial_v0_9_3.pdf/download" target="_blank"> +<a href="https://sourceforge.net/projects/postgres-xc/files/Version_0.9.4/PG-XC_pgbench_Tutorial_v0_9_4.pdf/download" target="_blank"> (download) </a> </li> <!-- DBT-1 Tutorial Manual --> <li> -<code>PG-XC_DBT1_Tutorial_v0_9_3.pdf</code>: <br> +<code>PG-XC_DBT1_Tutorial_v0_9_4.pdf</code>: <br> Step by step description how to build and configure DBT-1 to run with Postgres-XC. ⇒ -<a href="https://sourceforge.net/projects/postgres-xc/files/Version_0.9.3/PG-XC_DBT1_Tutorial_v0_9_3.pdf/download" target="_blank"> +<a href="https://sourceforge.net/projects/postgres-xc/files/Version_0.9.4/PG-XC_DBT1_Tutorial_v0_9_4.pdf/download" target="_blank"> (download) </a> </li> <!-- Install Manual --> <li> -<code>PG-XC_InstallManual_v0_9_3.pdf</code>: <br> +<code>PG-XC_InstallManual_v0_9_4.pdf</code>: <br> Step by step description how to build, install and configure Postgres-XC. ⇒ -<a href="https://sourceforge.net/projects/postgres-xc/files/Version_0.9.3/PG-XC_InstallManual_v0_9_3.pdf/download" target="_blank"> +<a href="https://sourceforge.net/projects/postgres-xc/files/Version_0.9.4/PG-XC_InstallManual_v0_9_4.pdf/download" target="_blank"> (download) </a> </li> <!-- SQL limitation manual --> <li> -<code>PG-XC_SQL_Limitations_v0_9_3.pdf</code>: <br> -SQL restrictions available for Postgres-XC 0.9.3. -⇒ -<a href="https://sourceforge.net/projects/postgres-xc/files/Version_0.9.3/PG-XC_SQL_Limitations_v0_9_3.pdf/download" target="_blank"> -(download) -</a> -</li> - -<li> -<code>PG-XC_Configurator_v0_9_3.pdf</code>: <br> -Description of Postgres-XC cluster-wide configurator. -⇒ -<a href="https://sourceforge.net/projects/postgres-xc/files/Version_0.9.3/PG-XC_Configurator_v0_9_3.pdf/download"> -(download) -</a> -</li> - -<li> -<code>pgxc_config_v0_9_3.tar.gz</code>: <br> -Postgres-XC configurator. Written in Ruby and recommended to set up easily a Postgres-XC environment. -⇒ -<a href="https://sourceforge.net/projects/postgres-xc/files/Version_0.9.3/pgxc_config_v0_9_3.tar.gz/download"> -(download) -</a> -</li> - -<!-- Architecture Document --> -<li> -<code>PG-XC_Architecture_v0_9.pdf</code>: <br> -Description of the outline of Postgres-XC internals. +<code>PG-XC_SQL_Limitations_v0_9_4.pdf</code>: <br> +SQL restrictions available for Postgres-XC 0.9.4. ⇒ -<a href="https://sourceforge.net/projects/postgres-xc/files/Version_0.9/PG-XC_Architecture.pdf/download" target="_blank"> +<a href="https://sourceforge.net/projects/postgres-xc/files/Version_0.9.4/PG-XC_SQL_Limitations_v0_9_4.pdf/download" target="_blank"> (download) </a> </li> diff --git a/events.html b/events.html index 0ded082..4bd7009 100755 --- a/events.html +++ b/events.html @@ -33,10 +33,10 @@ Description of this event. UPDATES --> <h2 class="plain">Updates</h2> -<!-- Postgres-XC 0.9.3 download --> +<!-- Postgres-XC 0.9.4 download --> <p class="plain"> -Postgres-XC 0.9.3 is now available!! Download -<a href="https://sourceforge.net/projects/postgres-xc/files/Version_0.9.3/pgxc_v0_9_3.tar.gz/download" target="_blank"> +Postgres-XC 0.9.4 is now available!! Download +<a href="https://sourceforge.net/projects/postgres-xc/files/Version_0.9.4/pgxc_v0_9_4.tar.gz/download" target="_blank"> here. </a> </p> diff --git a/license.html b/license.html index bedcd44..639560c 100755 --- a/license.html +++ b/license.html @@ -20,27 +20,49 @@ License </h2> <p> -Postgres-XC read/write scalable synchronous multi-master database cluster. +Postgres-XC Cluster Database Management System </p> <p> -Copyright (C) 2010 NTT Open Source Software Center +Portions Copyright (c) 2010-2011, Nippon Telegraph and Telephone Corporation<br /> +Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group </p> <p> -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License. +Portions Copyright (c) 1994, The Regents of the University of California<br /> </p> <p> -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. +Permission to use, copy, modify, and distribute this software and its<br /> +documentation for any purpose, without fee, and without a written agreement<br /> +is hereby granted, provided that the above copyright notice and this<br /> +paragraph and the following two paragraphs appear in all copies. </p> <p> -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR<br /> +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING<br /> +LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS<br /> +DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE<br /> +POSSIBILITY OF SUCH DAMAGE. </p> +<p> +THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,<br /> +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY<br /> +AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS<br /> +ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO<br /> +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +</p> +<p> +IN NO EVENT SHALL POSTGRESQL GLOBAL DEVELOPMENT GROUP BE LIABLE TO ANY<br /> +PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL<br /> +DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS<br /> +SOFTWARE AND ITS DOCUMENTATION, EVEN IF POSTGRESQL GLOBAL DEVELOPMENT<br /> +GROUP HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.<br /> +</p> +<p> +POSTGRESQL GLOBAL DEVELOPMENT GROUP SPECIFICALLY DISCLAIMS ANY WARRANTIES,<br /> +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY<br /> +AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS<br /> +ON AN "AS IS" BASIS, AND THE POSTGRESQL GLOBAL DEVELOPMENT GROUP HAS NO OBLIGATIONS TO<br /> +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +</p> +<p><em>Since Postgres-XC 0.9.4, Licence is BSD<br />Prior to 0.9.3, License was LGPL 2.0</em></p> </body> </html> diff --git a/members.html b/members.html index 88bdf2a..f1d969f 100755 --- a/members.html +++ b/members.html @@ -32,37 +32,51 @@ PostgreSQL development.<br /> He is also the developer of XCM (XC cluster manager). </p> -<h4>Mason Sharp</h4> +<h4>Pavan Deolasee</h4> <p class="inner"> -Architect and development leader.<br /> -As a Coordinator developer, he has worked on planner and locator extensions.<br /> -He is also the main architect of GridSQL database cluster.<br /> +Global Transaction Manager and PITR/barrier developer.<br /> +He is well known as HOT developer in PostgreSQL.<br /> +He is also helping in source code review and PostgreSQL internals.<br /> </p> -<h4>Pavan Deolasee</h4> +<h4><a href="http://michael.otacoo.com/">Michael Paquier</a></h4> <p class="inner"> -Global Transaction Manager developer.<br /> -He is well known as HOT developer in PostgreSQL.<br /> -He is also helping in source code review and PostgreSQL internals.<br /> +Coordinator feature developer.<br /> +He has developed a couple of GTM features, pooler extension and DDL synchronization.<br /> +Lately, main focus is code stabilization and bug correction for regressions<br /> +He helped in modifying DBT-1 benchmark for Postgres-XC.<br /> +He also contributed to enhance pgbench in PostgreSQL 9.0. </p> -<h4>Andrei Martsinchyk</h4> +<h4>Abbas Butt</h4> <p class="inner"> -He has worked on Data Node, connection pooling and cursor support<br /> -He is also GridSQL developer and is now developing aggregate -functions and other cross-node operation. +Working on overall code stabilization and Coordinator functionalities<br /> +He has written the new distribution function MODULO. </p> -<h4><a href="http://michaelpq.users.sourceforge.net/">Michael Paquier</a></h4> +<h4>Ashutosh Bapat</h4> +<p class="inner"> +Has joined the project at release 0.9.4<br /> +Currently working on aggregates and GROUP BY<br /> +</p> + +<h4>Mason Sharp</h4> <p class="inner"> -Coordinator feature developer.<br /> -He has developed a couple of GTM features, pooler extension and DDL synchronization.<br /> -He helped in modifying DBT-1 benchmark for Postgres-XC.<br /> -He also contributed to enhance pgbench in PostgreSQL 9.0. +Architect and development leader.<br /> +As a Coordinator developer, he has worked on planner and locator extensions.<br /> +He is also the main architect of GridSQL database cluster.<br /> +</p> + +<h4>Andrei Martsinchyk</h4> + +<p class="inner"> +He has worked on Data Node, connection pooling and cursor support<br /> +He is also GridSQL developer and is now developing aggregate +functions and other cross-node operation. </p> <h4>Takayuki Suto</h4> diff --git a/prev_vers/version0_9.html b/prev_vers/version0_9.html index 487592e..4c7e3fb 100644 --- a/prev_vers/version0_9.html +++ b/prev_vers/version0_9.html @@ -354,5 +354,129 @@ Description of the outline of Postgres-XC internals. </a> </li> +<!-- Documents of version 0.9.3 --> +<h4> +Version 0.9.3 +</h4> + +<p> +<ul> +<!-- tarball of 0.9.3, main download--> +<li> +<code>pgxc_v0.9.3.tar.gz</code>: <br> +Latest version of Postgres-XC available.<br> +Please note that Postgres-XC documentation is not included in this file. +⇒ +<a href="https://sourceforge.net/projects/postgres-xc/files/Version_0.9.3/pgxc_v0_9_3.tar.gz/download" target="_blank"> +(download) +</a> +</li> + +<!-- tarball (diff) --> +<li> +<code>PGXC_v0_9_3-PG_REL8_4_3.patch.gz</code>: <br> +The same material as above, but this file includes only the patch to apply +to the PostgreSQL 8.4.3 release source code.<br> +It is useful if you would like to see just a difference between PostgreSQL +and Postgres-XC.<br> +No Postgres-XC documentation is included in this file either. +⇒ +<a href="https://sourceforge.net/projects/postgres-xc/files/Version_0.9.3/PGXC_v0_9_3-PG_REL8_4_3.patch.gz/download" target="_blank"> +(download) +</a> +</li> + +<!-- License --> +<li> +<code>COPYING</code>: <br> +License description. Postgres-XC is distributed under LGPL version 2.1 +⇒ +<a href="https://sourceforge.net/projects/postgres-xc/files/Version_0.9.3/COPYING/download" target="_blank"> +(download) +</a> +</li> + +<!-- Files --> +<li> +<code>FILES</code>: <br> +Description of files included in Postgres-XC 0.9.3 release. +⇒ +<a href="https://sourceforge.net/projects/postgres-xc/files/Version_0.9.3/FILES/download" target="_blank"> +(download) +</a> +</li> + +<!-- Reference Manual --> +<li> +<code>PG-XC_ReferenceManual_v0_9_3.pdf</code>: <br> +Reference of Postgres-XC extension. +⇒ +<a href="https://sourceforge.net/projects/postgres-xc/files/Version_0.9.3/PG-XC_ReferenceManual_v0_9_3.pdf/download" target="_blank"> +(download) +</a> +</li> + +<!-- pgbench Tutorial Manual --> +<li> +<code>PG-XC_pgbench_Tutorial_v0_9_3.pdf</code>: <br> +Step by step description how to build and configure pgbench to run with +Postgres-XC. +⇒ +<a href="https://sourceforge.net/projects/postgres-xc/files/Version_0.9.3/PG-XC_pgbench_Tutorial_v0_9_3.pdf/download" target="_blank"> +(download) +</a> +</li> + +<!-- DBT-1 Tutorial Manual --> +<li> +<code>PG-XC_DBT1_Tutorial_v0_9_3.pdf</code>: <br> +Step by step description how to build and configure DBT-1 to run with +Postgres-XC. +⇒ +<a href="https://sourceforge.net/projects/postgres-xc/files/Version_0.9.3/PG-XC_DBT1_Tutorial_v0_9_3.pdf/download" target="_blank"> +(download) +</a> +</li> + +<!-- Install Manual --> +<li> +<code>PG-XC_InstallManual_v0_9_3.pdf</code>: <br> +Step by step description how to build, install and configure Postgres-XC. +⇒ +<a href="https://sourceforge.net/projects/postgres-xc/files/Version_0.9.3/PG-XC_InstallManual_v0_9_3.pdf/download" target="_blank"> +(download) +</a> +</li> + +<!-- SQL limitation manual --> +<li> +<code>PG-XC_SQL_Limitations_v0_9_3.pdf</code>: <br> +SQL restrictions available for Postgres-XC 0.9.3. +⇒ +<a href="https://sourceforge.net/projects/postgres-xc/files/Version_0.9.3/PG-XC_SQL_Limitations_v0_9_3.pdf/download" target="_blank"> +(download) +</a> +</li> + +<li> +<code>PG-XC_Configurator_v0_9_3.pdf</code>: <br> +Description of Postgres-XC cluster-wide configurator. +⇒ +<a href="https://sourceforge.net/projects/postgres-xc/files/Version_0.9.3/PG-XC_Configurator_v0_9_3.pdf/download"> +(download) +</a> +</li> + +<li> +<code>pgxc_config_v0_9_3.tar.gz</code>: <br> +Postgres-XC configurator. Written in Ruby and recommended to set up easily a Postgres-XC environment. +⇒ +<a href="https://sourceforge.net/projects/postgres-xc/files/Version_0.9.3/pgxc_config_v0_9_3.tar.gz/download"> +(download) +</a> +</li> + + + </ul> </p> diff --git a/roadmap.html b/roadmap.html index 56bdca1..525f005 100755 --- a/roadmap.html +++ b/roadmap.html @@ -33,29 +33,27 @@ similar to PostgreSQL, except for savepoints. </p> <p> On the other hand, Postgres-XC needs to enhance support for general statements.<br /> -As of Version 0.9.3, Postgres-XC supports statements which can be executed +As of Version 0.9.4, Postgres-XC supports statements which can be executed on a single data node, or on multiple nodes for single and multi step.<br /> This new version adds support for:<br /> <ul> -<li>Cursor Support</li> -<li>Basic cross-node operation</li> -<li>Global timestamp</li> -<li>DDL synchronisation</li> -<li>Cluster-wide installer</li> -<li>Cluster-wide operation utilities</li> -<li>Driver support (ECPG, JDBC, PHP, etc.)</li> -<li>Extended Query Protocol (for JDBC)</li> -<li>Support of external 2PC from application</li> +<li>pg_regress</li> +<li>Merge with PostgreSQL 9.0.3</li> +<li>Pooler connection clean-up with CLEAN CONNECTION</li> +<li>EXECUTE DIRECT support, launch queries directly on target nodes!</li> +<li>INSERT SELECT basic support</li> +<li>IMMEDIATE constraints</li> +<li>Code stabilization (No crash, no freeze whatver the query) and a loooot of bugs fixed!</li> </ul> -However there are some limitations please refer to <a href="https://sourceforge.net/projects/postgres-xc/files/Version_0.9.3/PG-XC_SQL_Limitations_v0_9_3.pdf/download" target="_blank"> +However there are some limitations please refer to <a href="https://sourceforge.net/projects/postgres-xc/files/Version_0.9.4/PG-XC_SQL_Limitations_v0_9_4.pdf/download" target="_blank"> SQL Limitations </a> document for further details. </p> <p> There is no support yet for <code>SELECT</code> in <code>FROM</code> clause. </p> -<p>We will be expanding the coverage of supported SQL and as well High-Availability (HA) features in the coming months.</p> +<p>We will be expanding the coverage of supported SQL, stabilization and High-Availability (HA) features in the coming months.</p> <!-- ==== Planned feature === --> <h3> Upcoming Releases and Features @@ -87,13 +85,19 @@ subqueries<br> <!-- ==== For Version 1.0 ==== --> <h4> -Version 0.9.4 (March, 2011) +Version 0.9.5 (March, 2011) </h4> <p class="inner"> <ul> <li>License modified from LGPL to BSD</li> -<li>Merge with PostgreSQL 9.0.3</li> +<li>SQL/plpgsql functions</li> +<li>GROUP BY</li> +<li>CURRENT OF</li> +<li>pg_regress extension</li> +<li>ROLE, GRANT, REVOKE</li> +<li>Pooler for multiple users</li> +<li>Session and local parameters</li> <li>HA Capability <ul> <li>Datanode mirroring functionality: multiple Datanodes seen as only one node,<br /> @@ -111,13 +115,16 @@ Version 0.9.4 (March, 2011) <!-- === Beyond Version 1.0 === ---> <h4> -After Version 0.9.4, on the way to Version 1.0 +After Version 0.9.5, on the way to Version 1.0 </h4> <p class="inner"> <ul> <li>PITR cluster-wide recovery</li> +<li>Standby node method based on PostgreSQL's HOT Standby</li> <li>Trigger</li> +<li>SELECT INTO</li> +<li>SSL connection protocol for pooler (secure your cluster!)</li> <li>Temporary (TEMP) tables</li> <li>HOT standby full support</li> <li>Cross-node operation optimization</li> ----------------------------------------------------------------------- Summary of changes: download.html | 80 +++++++---------------------- events.html | 6 +- license.html | 48 +++++++++++++----- members.html | 48 +++++++++++------ prev_vers/version0_9.html | 124 +++++++++++++++++++++++++++++++++++++++++++++ roadmap.html | 37 ++++++++------ 6 files changed, 234 insertions(+), 109 deletions(-) hooks/post-receive -- website |
From: Michael P. <mic...@gm...> - 2011-04-12 04:31:57
|
I just reverted the commit, to keep in mind the problem. -- Thanks, Michael Paquier http://michael.otacoo.com |
From: Michael P. <mic...@us...> - 2011-04-12 04:30:41
|
Project "Postgres-XC". The branch, master has been updated via 2764f7b5379e3eb66d038a74aa0031e29a0de72c (commit) from 3b9ec2e609dbe7d745f88e28d779e46d62abf3d8 (commit) - Log ----------------------------------------------------------------- commit 2764f7b5379e3eb66d038a74aa0031e29a0de72c Author: Michael P <mic...@us...> Date: Tue Apr 12 13:26:05 2011 +0900 Revert commit dc2762989aaf0946219444d81b12222ac3b553a0 cache lookup for test misc As long as the root problem has not been found in test case misc, regression test remains as FAILED. diff --git a/src/backend/utils/cache/typcache.c b/src/backend/utils/cache/typcache.c index 0124eb0..2009614 100644 --- a/src/backend/utils/cache/typcache.c +++ b/src/backend/utils/cache/typcache.c @@ -143,11 +143,7 @@ lookup_type_cache(Oid type_id, int flags) tp = SearchSysCache1(TYPEOID, ObjectIdGetDatum(type_id)); if (!HeapTupleIsValid(tp)) -#ifdef PGXC - elog(ERROR, "cache lookup failed for type"); -#else elog(ERROR, "cache lookup failed for type %u", type_id); -#endif typtup = (Form_pg_type) GETSTRUCT(tp); if (!typtup->typisdefined) ereport(ERROR, diff --git a/src/test/regress/output/misc_1.source b/src/test/regress/output/misc_1.source deleted file mode 100644 index 1c8e7af..0000000 --- a/src/test/regress/output/misc_1.source +++ /dev/null @@ -1,651 +0,0 @@ --- --- MISC --- --- --- BTREE --- -UPDATE onek - SET unique1 = onek.unique1 + 1; -ERROR: Partition column can't be updated in current version -UPDATE onek - SET unique1 = onek.unique1 - 1; -ERROR: Partition column can't be updated in current version --- --- BTREE partial --- --- UPDATE onek2 --- SET unique1 = onek2.unique1 + 1; ---UPDATE onek2 --- SET unique1 = onek2.unique1 - 1; --- --- BTREE shutting out non-functional updates --- --- the following two tests seem to take a long time on some --- systems. This non-func update stuff needs to be examined --- more closely. - jolly (2/22/96) --- -UPDATE tmp - SET stringu1 = reverse_name(onek.stringu1) - FROM onek - WHERE onek.stringu1 = 'JBAAAA' and - onek.stringu1 = tmp.stringu1; -ERROR: relation "tmp" does not exist -LINE 1: UPDATE tmp - ^ -UPDATE tmp - SET stringu1 = reverse_name(onek2.stringu1) - FROM onek2 - WHERE onek2.stringu1 = 'JCAAAA' and - onek2.stringu1 = tmp.stringu1; -ERROR: relation "tmp" does not exist -LINE 1: UPDATE tmp - ^ -DROP TABLE tmp; -ERROR: table "tmp" does not exist ---UPDATE person* --- SET age = age + 1; ---UPDATE person* --- SET age = age + 3 --- WHERE name = 'linda'; --- --- copy --- -COPY onek TO '@abs_builddir@/results/onek.data'; -DELETE FROM onek; -COPY onek FROM '@abs_builddir@/results/onek.data'; -SELECT unique1 FROM onek WHERE unique1 < 2 ORDER BY unique1; - unique1 ---------- - 0 - 1 -(2 rows) - -DELETE FROM onek2; -COPY onek2 FROM '@abs_builddir@/results/onek.data'; -SELECT unique1 FROM onek2 WHERE unique1 < 2 ORDER BY unique1; - unique1 ---------- - 0 - 1 -(2 rows) - -COPY BINARY stud_emp TO '@abs_builddir@/results/stud_emp.data'; -DELETE FROM stud_emp; -COPY BINARY stud_emp FROM '@abs_builddir@/results/stud_emp.data'; -ERROR: Error while running COPY -SELECT * FROM stud_emp ORDER BY 1,2; - name | age | location | salary | manager | gpa | percent -------+-----+----------+--------+---------+-----+--------- -(0 rows) - --- COPY aggtest FROM stdin; --- 56 7.8 --- 100 99.097 --- 0 0.09561 --- 42 324.78 --- . --- COPY aggtest TO stdout; --- --- inheritance stress test --- -SELECT * FROM a_star* ORDER BY 1,2; - class | a --------+---- - a | 1 - a | 2 - a | - b | 3 - b | 4 - b | - b | - c | 5 - c | 6 - c | - c | - d | 7 - d | 8 - d | 9 - d | 10 - d | 11 - d | 12 - d | 13 - d | 14 - d | - d | - d | - d | - d | - d | - d | - d | - e | 15 - e | 16 - e | 17 - e | 18 - e | - e | - e | - f | 19 - f | 20 - f | 21 - f | 22 - f | 24 - f | 25 - f | 26 - f | 27 - f | - f | - f | - f | - f | - f | - f | - f | -(50 rows) - -SELECT * - FROM b_star* x - WHERE x.b = text 'bumble' or x.a < 3; - class | a | b --------+---+-------- - b | | bumble -(1 row) - -SELECT class, a - FROM c_star* x - WHERE x.c ~ text 'hi' ORDER BY 1,2; - class | a --------+---- - c | 5 - c | - e | 15 - e | 16 - e | - e | - f | 19 - f | 20 - f | 21 - f | 24 - f | - f | - f | - f | -(14 rows) - -SELECT class, b, c - FROM d_star* x - WHERE x.a < 100 ORDER BY 1,2,3; - class | b | c --------+---------+------------ - d | fumble | - d | grumble | hi sunita - d | rumble | - d | stumble | hi koko - d | | hi avi - d | | hi kristin - d | | - d | | -(8 rows) - -SELECT class, c FROM e_star* x WHERE x.c NOTNULL ORDER BY 1,2; - class | c --------+------------- - e | hi bob - e | hi carol - e | hi elisa - e | hi michelle - f | hi allison - f | hi carl - f | hi claire - f | hi jeff - f | hi keith - f | hi marc - f | hi marcel - f | hi mike -(12 rows) - -SELECT * FROM f_star* x WHERE x.c ISNULL ORDER BY 1,2; - class | a | c | e | f --------+----+---+-----+------------------------------------------- - f | 22 | | -7 | ((111,555),(222,666),(333,777),(444,888)) - f | 25 | | -9 | - f | 26 | | | ((11111,33333),(22222,44444)) - f | 27 | | | - f | | | -11 | ((1111111,3333333),(2222222,4444444)) - f | | | -12 | - f | | | | ((11111111,33333333),(22222222,44444444)) - f | | | | -(8 rows) - --- grouping and aggregation on inherited sets have been busted in the past... -SELECT sum(a) FROM a_star*; - sum ------ - 355 -(1 row) - -SELECT class, sum(a) FROM a_star* GROUP BY class ORDER BY class; -ERROR: GROUP BY clause is not yet supported -ALTER TABLE f_star RENAME COLUMN f TO ff; -ALTER TABLE e_star* RENAME COLUMN e TO ee; -ALTER TABLE d_star* RENAME COLUMN d TO dd; -ALTER TABLE c_star* RENAME COLUMN c TO cc; -ALTER TABLE b_star* RENAME COLUMN b TO bb; -ALTER TABLE a_star* RENAME COLUMN a TO aa; -SELECT class, aa - FROM a_star* x - WHERE aa ISNULL ORDER BY 1,2; - class | aa --------+---- - a | - b | - b | - c | - c | - d | - d | - d | - d | - d | - d | - d | - d | - e | - e | - e | - f | - f | - f | - f | - f | - f | - f | - f | -(24 rows) - --- As of Postgres 7.1, ALTER implicitly recurses, --- so this should be same as ALTER a_star* -ALTER TABLE a_star RENAME COLUMN aa TO foo; -SELECT class, foo - FROM a_star* x - WHERE x.foo >= 2 ORDER BY 1,2; - class | foo --------+----- - a | 2 - b | 3 - b | 4 - c | 5 - c | 6 - d | 7 - d | 8 - d | 9 - d | 10 - d | 11 - d | 12 - d | 13 - d | 14 - e | 15 - e | 16 - e | 17 - e | 18 - f | 19 - f | 20 - f | 21 - f | 22 - f | 24 - f | 25 - f | 26 - f | 27 -(25 rows) - -ALTER TABLE a_star RENAME COLUMN foo TO aa; -SELECT * - from a_star* - WHERE aa < 1000 ORDER BY 1,2; - class | aa --------+---- - a | 1 - a | 2 - b | 3 - b | 4 - c | 5 - c | 6 - d | 7 - d | 8 - d | 9 - d | 10 - d | 11 - d | 12 - d | 13 - d | 14 - e | 15 - e | 16 - e | 17 - e | 18 - f | 19 - f | 20 - f | 21 - f | 22 - f | 24 - f | 25 - f | 26 - f | 27 -(26 rows) - -ALTER TABLE f_star ADD COLUMN f int4; -UPDATE f_star SET f = 10; -ALTER TABLE e_star* ADD COLUMN e int4; ---UPDATE e_star* SET e = 42; -SELECT * FROM e_star* ORDER BY 1,2,3,4; - class | aa | cc | ee | e --------+----+-------------+-----+--- - e | 15 | hi carol | -1 | - e | 16 | hi bob | | - e | 17 | | -2 | - e | 18 | | | - e | | hi elisa | | - e | | hi michelle | -3 | - e | | | -4 | - f | 19 | hi claire | -5 | - f | 20 | hi mike | -6 | - f | 21 | hi marcel | | - f | 22 | | -7 | - f | 24 | hi marc | | - f | 25 | | -9 | - f | 26 | | | - f | 27 | | | - f | | hi allison | -10 | - f | | hi carl | | - f | | hi jeff | | - f | | hi keith | -8 | - f | | | -12 | - f | | | -11 | - f | | | | - f | | | | -(23 rows) - -ALTER TABLE a_star* ADD COLUMN a text; ---UPDATE b_star* --- SET a = text 'gazpacho' --- WHERE aa > 4; -SELECT class, aa, a FROM a_star* ORDER BY 1,2; - class | aa | a --------+----+--- - a | 1 | - a | 2 | - a | | - b | 3 | - b | 4 | - b | | - b | | - c | 5 | - c | 6 | - c | | - c | | - d | 7 | - d | 8 | - d | 9 | - d | 10 | - d | 11 | - d | 12 | - d | 13 | - d | 14 | - d | | - d | | - d | | - d | | - d | | - d | | - d | | - d | | - e | 15 | - e | 16 | - e | 17 | - e | 18 | - e | | - e | | - e | | - f | 19 | - f | 20 | - f | 21 | - f | 22 | - f | 24 | - f | 25 | - f | 26 | - f | 27 | - f | | - f | | - f | | - f | | - f | | - f | | - f | | - f | | -(50 rows) - --- --- versions --- --- --- postquel functions --- --- --- mike does post_hacking, --- joe and sally play basketball, and --- everyone else does nothing. --- -SELECT p.name, name(p.hobbies) FROM ONLY person p ORDER BY 1,2; -ERROR: cache lookup failed for type -CONTEXT: SQL function "hobbies" statement 1 --- --- as above, but jeff also does post_hacking. --- -SELECT p.name, name(p.hobbies) FROM person* p ORDER BY 1,2; -ERROR: cache lookup failed for type -CONTEXT: SQL function "hobbies" statement 1 --- --- the next two queries demonstrate how functions generate bogus duplicates. --- this is a "feature" .. --- -SELECT DISTINCT hobbies_r.name, name(hobbies_r.equipment) FROM hobbies_r - ORDER BY 1,2; -ERROR: cache lookup failed for type -CONTEXT: SQL function "equipment" statement 1 -SELECT hobbies_r.name, (hobbies_r.equipment).name FROM hobbies_r ORDER BY 1,2; -ERROR: cache lookup failed for type -CONTEXT: SQL function "equipment" statement 1 --- --- mike needs advil and peet's coffee, --- joe and sally need hightops, and --- everyone else is fine. --- -SELECT p.name, name(p.hobbies), name(equipment(p.hobbies)) FROM ONLY person p ORDER BY 1,2,3; -ERROR: cache lookup failed for type -CONTEXT: SQL function "hobbies" statement 1 --- --- as above, but jeff needs advil and peet's coffee as well. --- -SELECT p.name, name(p.hobbies), name(equipment(p.hobbies)) FROM person* p ORDER BY 1,2,3; -ERROR: cache lookup failed for type -CONTEXT: SQL function "hobbies" statement 1 --- --- just like the last two, but make sure that the target list fixup and --- unflattening is being done correctly. --- -SELECT name(equipment(p.hobbies)), p.name, name(p.hobbies) FROM ONLY person p ORDER BY 1,2,3; -ERROR: cache lookup failed for type -CONTEXT: SQL function "hobbies" statement 1 -SELECT (p.hobbies).equipment.name, p.name, name(p.hobbies) FROM person* p ORDER BY 1,2,3; -ERROR: cache lookup failed for type -CONTEXT: SQL function "hobbies" statement 1 -SELECT (p.hobbies).equipment.name, name(p.hobbies), p.name FROM ONLY person p ORDER BY 1,2,3; -ERROR: cache lookup failed for type -CONTEXT: SQL function "hobbies" statement 1 -SELECT name(equipment(p.hobbies)), name(p.hobbies), p.name FROM person* p ORDER BY 1,2,3; -ERROR: cache lookup failed for type -CONTEXT: SQL function "hobbies" statement 1 -SELECT user_relns() AS user_relns - ORDER BY user_relns; - user_relns ---------------------- - a - a_star - abstime_tbl - aggtest - aggtype - array_index_op_test - array_op_test - arrtest - b - b_star - box_tbl - bt_f8_heap - bt_i4_heap - bt_name_heap - bt_txt_heap - c - c_star - char_tbl - check2_tbl - check_seq - check_tbl - circle_tbl - city - copy_tbl - d_star - date_tbl - default_seq - default_tbl - dept - e_star - emp - equipment_r - f_star - fast_emp4000 - firstparent - float4_tbl - float8_tbl - foobar - func_index_heap - hash_f8_heap - hash_i4_heap - hash_name_heap - hash_txt_heap - hobbies_r - ihighway - inet_tbl - inhe - inhf - inhx - insert_seq - int2_tbl - int4_tbl - int8_tbl - interval_tbl - iportaltest - log_table - lseg_tbl - main_table - money_data - num_data - num_exp_add - num_exp_div - num_exp_ln - num_exp_log10 - num_exp_mul - num_exp_power_10_ln - num_exp_sqrt - num_exp_sub - num_input_test - num_result - onek - onek2 - path_tbl - person - point_tbl - polygon_tbl - pxtest1 - real_city - reltime_tbl - road - secondparent - shighway - slow_emp4000 - street - stud_emp - student - subselect_tbl - tenk1 - tenk2 - test_tsvector - text_tbl - thirdparent - time_tbl - timestamp_tbl - timestamptz_tbl - timetz_tbl - tinterval_tbl - toyemp - varchar_tbl - writetest -(100 rows) - -SELECT name(equipment(hobby_construct(text 'skywalking', text 'mer'))); - name ------- -(0 rows) - -SELECT hobbies_by_name('basketball'); - hobbies_by_name ------------------ - -(1 row) - -SELECT name, overpaid(emp.*) FROM emp ORDER BY 1,2; -ERROR: cache lookup failed for type --- --- Try a few cases with SQL-spec row constructor expressions --- -SELECT * FROM equipment(ROW('skywalking', 'mer')); - name | hobby -------+------- -(0 rows) - -SELECT name(equipment(ROW('skywalking', 'mer'))); - name ------- -(0 rows) - -SELECT *, name(equipment(h.*)) FROM hobbies_r h ORDER BY 1,2,3; -ERROR: cache lookup failed for type -CONTEXT: SQL function "equipment" statement 1 -SELECT *, (equipment(CAST((h.*) AS hobbies_r))).name FROM hobbies_r h ORDER BY 1,2,3; -ERROR: cache lookup failed for type -CONTEXT: SQL function "equipment" statement 1 --- --- check that old-style C functions work properly with TOASTed values --- -create table oldstyle_test(i int4, t text); -insert into oldstyle_test values(null,null); -insert into oldstyle_test values(0,'12'); -insert into oldstyle_test values(1000,'12'); -insert into oldstyle_test values(0, repeat('x', 50000)); -select i, length(t), octet_length(t), oldstyle_length(i,t) from oldstyle_test ORDER BY 1,2,3; - i | length | octet_length | oldstyle_length -------+--------+--------------+----------------- - 0 | 2 | 2 | 2 - 0 | 50000 | 50000 | 50000 - 1000 | 2 | 2 | 1002 - | | | -(4 rows) - -drop table oldstyle_test; --- --- functional joins --- --- --- instance rules --- --- --- rewrite rules --- ----------------------------------------------------------------------- Summary of changes: src/backend/utils/cache/typcache.c | 4 - src/test/regress/output/misc_1.source | 651 --------------------------------- 2 files changed, 0 insertions(+), 655 deletions(-) delete mode 100644 src/test/regress/output/misc_1.source hooks/post-receive -- Postgres-XC |
From: Abbas B. <abb...@te...> - 2011-04-12 04:09:15
|
Ok, lets find a better solution then. Thanks. On Tue, Apr 12, 2011 at 8:48 AM, Michael Paquier <mic...@gm...>wrote: > I am not sure this is a good commit... > We should avoid as much as possible to push output files that do not return > clean errors. > > Based on my latest regression tests, the cache lookup problem is also > happening in rangefunc, aggregates and plpgsql. > -- > Thanks, > > Michael Paquier > http://michael.otacoo.com > |
From: Michael P. <mic...@gm...> - 2011-04-12 03:48:18
|
I am not sure this is a good commit... We should avoid as much as possible to push output files that do not return clean errors. Based on my latest regression tests, the cache lookup problem is also happening in rangefunc, aggregates and plpgsql. -- Thanks, Michael Paquier http://michael.otacoo.com |
From: Abbas B. <abb...@te...> - 2011-04-12 03:42:29
|
The only intention here is to make sure the misc test case produces a consistent output, and this is a temp fix. The task of SQL functions has already been assigned and will be dealt with in next month. On Tue, Apr 12, 2011 at 8:28 AM, Pavan Deolasee <pav...@gm...>wrote: > > What is the intention for this change ? Should we not instead fix the root > cause ? > > Thanks, > Pavan > > Sent from my iPhone > > On 12-Apr-2011, at 2:43 AM, "Abbas Butt" <ga...@us...> > wrote: > > > Project "Postgres-XC". > > > > The branch, master has been updated > > via dc2762989aaf0946219444d81b12222ac3b553a0 (commit) > > from 988a22ba73575b836ea2842c17fc375305fdc266 (commit) > > > > > > - Log ----------------------------------------------------------------- > > commit dc2762989aaf0946219444d81b12222ac3b553a0 > > Author: Abbas <abb...@en...> > > Date: Tue Apr 12 02:13:25 2011 +0500 > > > > To make sure misc test cases passes > > > > diff --git a/src/backend/utils/cache/typcache.c > b/src/backend/utils/cache/typcache.c > > index 2009614..0124eb0 100644 > > --- a/src/backend/utils/cache/typcache.c > > +++ b/src/backend/utils/cache/typcache.c > > @@ -143,7 +143,11 @@ lookup_type_cache(Oid type_id, int flags) > > > > tp = SearchSysCache1(TYPEOID, ObjectIdGetDatum(type_id)); > > if (!HeapTupleIsValid(tp)) > > +#ifdef PGXC > > + elog(ERROR, "cache lookup failed for type"); > > +#else > > elog(ERROR, "cache lookup failed for type %u", type_id); > > +#endif > > typtup = (Form_pg_type) GETSTRUCT(tp); > > if (!typtup->typisdefined) > > ereport(ERROR, > > diff --git a/src/test/regress/expected/misc_1.out > b/src/test/regress/expected/misc_1.out > > index 9f32b64..322fd26 100644 > > --- a/src/test/regress/expected/misc_1.out > > +++ b/src/test/regress/expected/misc_1.out > > @@ -435,13 +435,13 @@ SELECT class, aa, a FROM a_star* ORDER BY 1,2; > > -- everyone else does nothing. > > -- > > SELECT p.name, name(p.hobbies) FROM ONLY person p ORDER BY 1,2; > > -ERROR: cache lookup failed for type 24546176 > > +ERROR: cache lookup failed for type > > CONTEXT: SQL function "hobbies" statement 1 > > -- > > -- as above, but jeff also does post_hacking. > > -- > > SELECT p.name, name(p.hobbies) FROM person* p ORDER BY 1,2; > > -ERROR: cache lookup failed for type 24546176 > > +ERROR: cache lookup failed for type > > CONTEXT: SQL function "hobbies" statement 1 > > -- > > -- the next two queries demonstrate how functions generate bogus > duplicates. > > @@ -449,10 +449,10 @@ CONTEXT: SQL function "hobbies" statement 1 > > -- > > SELECT DISTINCT hobbies_r.name, name(hobbies_r.equipment) FROM hobbies_r > > ORDER BY 1,2; > > -ERROR: cache lookup failed for type 1801675112 > > +ERROR: cache lookup failed for type > > CONTEXT: SQL function "equipment" statement 1 > > SELECT hobbies_r.name, (hobbies_r.equipment).name FROM hobbies_r ORDER > BY 1,2; > > -ERROR: cache lookup failed for type 1801675112 > > +ERROR: cache lookup failed for type > > CONTEXT: SQL function "equipment" statement 1 > > -- > > -- mike needs advil and peet's coffee, > > @@ -460,29 +460,29 @@ CONTEXT: SQL function "equipment" statement 1 > > -- everyone else is fine. > > -- > > SELECT p.name, name(p.hobbies), name(equipment(p.hobbies)) FROM ONLY > person p ORDER BY 1,2,3; > > -ERROR: cache lookup failed for type 24546176 > > +ERROR: cache lookup failed for type > > CONTEXT: SQL function "hobbies" statement 1 > > -- > > -- as above, but jeff needs advil and peet's coffee as well. > > -- > > SELECT p.name, name(p.hobbies), name(equipment(p.hobbies)) FROM person* > p ORDER BY 1,2,3; > > -ERROR: cache lookup failed for type 24546176 > > +ERROR: cache lookup failed for type > > CONTEXT: SQL function "hobbies" statement 1 > > -- > > -- just like the last two, but make sure that the target list fixup and > > -- unflattening is being done correctly. > > -- > > SELECT name(equipment(p.hobbies)), p.name, name(p.hobbies) FROM ONLY > person p ORDER BY 1,2,3; > > -ERROR: cache lookup failed for type 24546176 > > +ERROR: cache lookup failed for type > > CONTEXT: SQL function "hobbies" statement 1 > > SELECT (p.hobbies).equipment.name, p.name, name(p.hobbies) FROM person* > p ORDER BY 1,2,3; > > -ERROR: cache lookup failed for type 24546176 > > +ERROR: cache lookup failed for type > > CONTEXT: SQL function "hobbies" statement 1 > > SELECT (p.hobbies).equipment.name, name(p.hobbies), p.name FROM ONLY > person p ORDER BY 1,2,3; > > -ERROR: cache lookup failed for type 24546176 > > +ERROR: cache lookup failed for type > > CONTEXT: SQL function "hobbies" statement 1 > > SELECT name(equipment(p.hobbies)), name(p.hobbies), p.name FROM person* > p ORDER BY 1,2,3; > > -ERROR: cache lookup failed for type 24546176 > > +ERROR: cache lookup failed for type > > CONTEXT: SQL function "hobbies" statement 1 > > SELECT user_relns() AS user_relns > > ORDER BY user_relns; > > @@ -602,7 +602,7 @@ SELECT hobbies_by_name('basketball'); > > (1 row) > > > > SELECT name, overpaid(emp.*) FROM emp ORDER BY 1,2; > > -ERROR: cache lookup failed for type 28271 > > +ERROR: cache lookup failed for type > > -- > > -- Try a few cases with SQL-spec row constructor expressions > > -- > > @@ -617,10 +617,10 @@ SELECT name(equipment(ROW('skywalking', 'mer'))); > > (0 rows) > > > > SELECT *, name(equipment(h.*)) FROM hobbies_r h ORDER BY 1,2,3; > > -ERROR: cache lookup failed for type 1801675112 > > +ERROR: cache lookup failed for type > > CONTEXT: SQL function "equipment" statement 1 > > SELECT *, (equipment(CAST((h.*) AS hobbies_r))).name FROM hobbies_r h > ORDER BY 1,2,3; > > -ERROR: cache lookup failed for type 1801675112 > > +ERROR: cache lookup failed for type > > CONTEXT: SQL function "equipment" statement 1 > > -- > > -- check that old-style C functions work properly with TOASTed values > > > > ----------------------------------------------------------------------- > > > > Summary of changes: > > src/backend/utils/cache/typcache.c | 4 ++++ > > src/test/regress/expected/misc_1.out | 26 +++++++++++++------------- > > 2 files changed, 17 insertions(+), 13 deletions(-) > > > > > > hooks/post-receive > > -- > > Postgres-XC > > > > > ------------------------------------------------------------------------------ > > Forrester Wave Report - Recovery time is now measured in hours and > minutes > > not days. Key insights are discussed in the 2010 Forrester Wave Report as > > part of an in-depth evaluation of disaster recovery service providers. > > Forrester found the best-in-class provider in terms of services and > vision. > > Read this report now! http://p.sf.net/sfu/ibm-webcastpromo > > _______________________________________________ > > Postgres-xc-committers mailing list > > Pos...@li... > > https://lists.sourceforge.net/lists/listinfo/postgres-xc-committers > > > ------------------------------------------------------------------------------ > Forrester Wave Report - Recovery time is now measured in hours and minutes > not days. Key insights are discussed in the 2010 Forrester Wave Report as > part of an in-depth evaluation of disaster recovery service providers. > Forrester found the best-in-class provider in terms of services and vision. > Read this report now! http://p.sf.net/sfu/ibm-webcastpromo > _______________________________________________ > Postgres-xc-committers mailing list > Pos...@li... > https://lists.sourceforge.net/lists/listinfo/postgres-xc-committers > |
From: Pavan D. <pav...@gm...> - 2011-04-12 03:28:44
|
What is the intention for this change ? Should we not instead fix the root cause ? Thanks, Pavan Sent from my iPhone On 12-Apr-2011, at 2:43 AM, "Abbas Butt" <ga...@us...> wrote: > Project "Postgres-XC". > > The branch, master has been updated > via dc2762989aaf0946219444d81b12222ac3b553a0 (commit) > from 988a22ba73575b836ea2842c17fc375305fdc266 (commit) > > > - Log ----------------------------------------------------------------- > commit dc2762989aaf0946219444d81b12222ac3b553a0 > Author: Abbas <abb...@en...> > Date: Tue Apr 12 02:13:25 2011 +0500 > > To make sure misc test cases passes > > diff --git a/src/backend/utils/cache/typcache.c b/src/backend/utils/cache/typcache.c > index 2009614..0124eb0 100644 > --- a/src/backend/utils/cache/typcache.c > +++ b/src/backend/utils/cache/typcache.c > @@ -143,7 +143,11 @@ lookup_type_cache(Oid type_id, int flags) > > tp = SearchSysCache1(TYPEOID, ObjectIdGetDatum(type_id)); > if (!HeapTupleIsValid(tp)) > +#ifdef PGXC > + elog(ERROR, "cache lookup failed for type"); > +#else > elog(ERROR, "cache lookup failed for type %u", type_id); > +#endif > typtup = (Form_pg_type) GETSTRUCT(tp); > if (!typtup->typisdefined) > ereport(ERROR, > diff --git a/src/test/regress/expected/misc_1.out b/src/test/regress/expected/misc_1.out > index 9f32b64..322fd26 100644 > --- a/src/test/regress/expected/misc_1.out > +++ b/src/test/regress/expected/misc_1.out > @@ -435,13 +435,13 @@ SELECT class, aa, a FROM a_star* ORDER BY 1,2; > -- everyone else does nothing. > -- > SELECT p.name, name(p.hobbies) FROM ONLY person p ORDER BY 1,2; > -ERROR: cache lookup failed for type 24546176 > +ERROR: cache lookup failed for type > CONTEXT: SQL function "hobbies" statement 1 > -- > -- as above, but jeff also does post_hacking. > -- > SELECT p.name, name(p.hobbies) FROM person* p ORDER BY 1,2; > -ERROR: cache lookup failed for type 24546176 > +ERROR: cache lookup failed for type > CONTEXT: SQL function "hobbies" statement 1 > -- > -- the next two queries demonstrate how functions generate bogus duplicates. > @@ -449,10 +449,10 @@ CONTEXT: SQL function "hobbies" statement 1 > -- > SELECT DISTINCT hobbies_r.name, name(hobbies_r.equipment) FROM hobbies_r > ORDER BY 1,2; > -ERROR: cache lookup failed for type 1801675112 > +ERROR: cache lookup failed for type > CONTEXT: SQL function "equipment" statement 1 > SELECT hobbies_r.name, (hobbies_r.equipment).name FROM hobbies_r ORDER BY 1,2; > -ERROR: cache lookup failed for type 1801675112 > +ERROR: cache lookup failed for type > CONTEXT: SQL function "equipment" statement 1 > -- > -- mike needs advil and peet's coffee, > @@ -460,29 +460,29 @@ CONTEXT: SQL function "equipment" statement 1 > -- everyone else is fine. > -- > SELECT p.name, name(p.hobbies), name(equipment(p.hobbies)) FROM ONLY person p ORDER BY 1,2,3; > -ERROR: cache lookup failed for type 24546176 > +ERROR: cache lookup failed for type > CONTEXT: SQL function "hobbies" statement 1 > -- > -- as above, but jeff needs advil and peet's coffee as well. > -- > SELECT p.name, name(p.hobbies), name(equipment(p.hobbies)) FROM person* p ORDER BY 1,2,3; > -ERROR: cache lookup failed for type 24546176 > +ERROR: cache lookup failed for type > CONTEXT: SQL function "hobbies" statement 1 > -- > -- just like the last two, but make sure that the target list fixup and > -- unflattening is being done correctly. > -- > SELECT name(equipment(p.hobbies)), p.name, name(p.hobbies) FROM ONLY person p ORDER BY 1,2,3; > -ERROR: cache lookup failed for type 24546176 > +ERROR: cache lookup failed for type > CONTEXT: SQL function "hobbies" statement 1 > SELECT (p.hobbies).equipment.name, p.name, name(p.hobbies) FROM person* p ORDER BY 1,2,3; > -ERROR: cache lookup failed for type 24546176 > +ERROR: cache lookup failed for type > CONTEXT: SQL function "hobbies" statement 1 > SELECT (p.hobbies).equipment.name, name(p.hobbies), p.name FROM ONLY person p ORDER BY 1,2,3; > -ERROR: cache lookup failed for type 24546176 > +ERROR: cache lookup failed for type > CONTEXT: SQL function "hobbies" statement 1 > SELECT name(equipment(p.hobbies)), name(p.hobbies), p.name FROM person* p ORDER BY 1,2,3; > -ERROR: cache lookup failed for type 24546176 > +ERROR: cache lookup failed for type > CONTEXT: SQL function "hobbies" statement 1 > SELECT user_relns() AS user_relns > ORDER BY user_relns; > @@ -602,7 +602,7 @@ SELECT hobbies_by_name('basketball'); > (1 row) > > SELECT name, overpaid(emp.*) FROM emp ORDER BY 1,2; > -ERROR: cache lookup failed for type 28271 > +ERROR: cache lookup failed for type > -- > -- Try a few cases with SQL-spec row constructor expressions > -- > @@ -617,10 +617,10 @@ SELECT name(equipment(ROW('skywalking', 'mer'))); > (0 rows) > > SELECT *, name(equipment(h.*)) FROM hobbies_r h ORDER BY 1,2,3; > -ERROR: cache lookup failed for type 1801675112 > +ERROR: cache lookup failed for type > CONTEXT: SQL function "equipment" statement 1 > SELECT *, (equipment(CAST((h.*) AS hobbies_r))).name FROM hobbies_r h ORDER BY 1,2,3; > -ERROR: cache lookup failed for type 1801675112 > +ERROR: cache lookup failed for type > CONTEXT: SQL function "equipment" statement 1 > -- > -- check that old-style C functions work properly with TOASTed values > > ----------------------------------------------------------------------- > > Summary of changes: > src/backend/utils/cache/typcache.c | 4 ++++ > src/test/regress/expected/misc_1.out | 26 +++++++++++++------------- > 2 files changed, 17 insertions(+), 13 deletions(-) > > > hooks/post-receive > -- > Postgres-XC > > ------------------------------------------------------------------------------ > Forrester Wave Report - Recovery time is now measured in hours and minutes > not days. Key insights are discussed in the 2010 Forrester Wave Report as > part of an in-depth evaluation of disaster recovery service providers. > Forrester found the best-in-class provider in terms of services and vision. > Read this report now! http://p.sf.net/sfu/ibm-webcastpromo > _______________________________________________ > Postgres-xc-committers mailing list > Pos...@li... > https://lists.sourceforge.net/lists/listinfo/postgres-xc-committers |
From: Michael P. <mic...@us...> - 2011-04-12 03:10:21
|
Project "Postgres-XC". The branch, master has been updated via 3b9ec2e609dbe7d745f88e28d779e46d62abf3d8 (commit) from b17fd66a279122e8cb26fd6e7b557b212c26a10d (commit) - Log ----------------------------------------------------------------- commit 3b9ec2e609dbe7d745f88e28d779e46d62abf3d8 Author: Michael P <mic...@us...> Date: Tue Apr 12 12:06:28 2011 +0900 Fix for regression test domain TEMP tables, EXECUTE are not supported yet by Postgres-XC, so this output is correct. Some ORDER BY have also been added to have consistent results whatever the cluster configuration. diff --git a/src/test/regress/expected/domain_1.out b/src/test/regress/expected/domain_1.out new file mode 100644 index 0000000..07808af --- /dev/null +++ b/src/test/regress/expected/domain_1.out @@ -0,0 +1,533 @@ +-- +-- Test domains. +-- +-- Test Comment / Drop +create domain domaindroptest int4; +comment on domain domaindroptest is 'About to drop this..'; +create domain dependenttypetest domaindroptest; +-- fail because of dependent type +drop domain domaindroptest; +ERROR: cannot drop type domaindroptest because other objects depend on it +DETAIL: type dependenttypetest depends on type domaindroptest +HINT: Use DROP ... CASCADE to drop the dependent objects too. +drop domain domaindroptest cascade; +NOTICE: drop cascades to type dependenttypetest +-- this should fail because already gone +drop domain domaindroptest cascade; +ERROR: type "domaindroptest" does not exist +-- Test domain input. +-- Note: the point of checking both INSERT and COPY FROM is that INSERT +-- exercises CoerceToDomain while COPY exercises domain_in. +create domain domainvarchar varchar(5); +create domain domainnumeric numeric(8,2); +create domain domainint4 int4; +create domain domaintext text; +-- Test explicit coercions --- these should succeed (and truncate) +SELECT cast('123456' as domainvarchar); + domainvarchar +--------------- + 12345 +(1 row) + +SELECT cast('12345' as domainvarchar); + domainvarchar +--------------- + 12345 +(1 row) + +-- Test tables using domains +create table basictest + ( testint4 domainint4 + , testtext domaintext + , testvarchar domainvarchar + , testnumeric domainnumeric + ); +INSERT INTO basictest values ('88', 'haha', 'short', '123.12'); -- Good +INSERT INTO basictest values ('88', 'haha', 'short text', '123.12'); -- Bad varchar +ERROR: value too long for type character varying(5) +INSERT INTO basictest values ('88', 'haha', 'short', '123.1212'); -- Truncate numeric +-- Test copy +COPY basictest (testvarchar) FROM stdin; -- fail +ERROR: value too long for type character varying(5) +CONTEXT: COPY basictest, line 1, column testvarchar: "notsoshorttext" +COPY basictest (testvarchar) FROM stdin; +select * from basictest order by 1, 2, 3, 4; + testint4 | testtext | testvarchar | testnumeric +----------+----------+-------------+------------- + 88 | haha | short | 123.12 + 88 | haha | short | 123.12 + | | short | +(3 rows) + +-- check that domains inherit operations from base types +select testtext || testvarchar as concat, testnumeric + 42 as sum +from basictest order by 1,2; + concat | sum +-----------+-------- + hahashort | 165.12 + hahashort | 165.12 + | +(3 rows) + +-- check that union/case/coalesce type resolution handles domains properly +select coalesce(4::domainint4, 7) is of (int4) as t; + t +--- + t +(1 row) + +select coalesce(4::domainint4, 7) is of (domainint4) as f; + f +--- + f +(1 row) + +select coalesce(4::domainint4, 7::domainint4) is of (domainint4) as t; + t +--- + t +(1 row) + +drop table basictest; +drop domain domainvarchar restrict; +drop domain domainnumeric restrict; +drop domain domainint4 restrict; +drop domain domaintext; +-- Test domains over array types +create domain domainint4arr int4[1]; +create domain domainchar4arr varchar(4)[2][3]; +create table domarrtest + ( testint4arr domainint4arr + , testchar4arr domainchar4arr + ); +INSERT INTO domarrtest values ('{2,2}', '{{"a","b"},{"c","d"}}'); +INSERT INTO domarrtest values ('{{2,2},{2,2}}', '{{"a","b"}}'); +INSERT INTO domarrtest values ('{2,2}', '{{"a","b"},{"c","d"},{"e","f"}}'); +INSERT INTO domarrtest values ('{2,2}', '{{"a"},{"c"}}'); +INSERT INTO domarrtest values (NULL, '{{"a","b","c"},{"d","e","f"}}'); +INSERT INTO domarrtest values (NULL, '{{"toolong","b","c"},{"d","e","f"}}'); +ERROR: value too long for type character varying(4) +select * from domarrtest order by 1, 2; + testint4arr | testchar4arr +---------------+--------------------- + {2,2} | {{a,b},{c,d}} + {2,2} | {{a,b},{c,d},{e,f}} + {2,2} | {{a},{c}} + {{2,2},{2,2}} | {{a,b}} + | {{a,b,c},{d,e,f}} +(5 rows) + +select testint4arr[1], testchar4arr[2:2] from domarrtest order by 1, 2; + testint4arr | testchar4arr +-------------+-------------- + 2 | {{c}} + 2 | {{c,d}} + 2 | {{c,d}} + | {} + | {{d,e,f}} +(5 rows) + +COPY domarrtest FROM stdin; +COPY domarrtest FROM stdin; -- fail +ERROR: value too long for type character varying(4) +CONTEXT: COPY domarrtest, line 1, column testchar4arr: "{qwerty,w,e}" +select * from domarrtest order by 1, 2; + testint4arr | testchar4arr +---------------+--------------------- + {2,2} | {{a,b},{c,d}} + {2,2} | {{a,b},{c,d},{e,f}} + {2,2} | {{a},{c}} + {{2,2},{2,2}} | {{a,b}} + {3,4} | {q,w,e} + | {{a,b,c},{d,e,f}} + | +(7 rows) + +drop table domarrtest; +drop domain domainint4arr restrict; +drop domain domainchar4arr restrict; +create domain dnotnull varchar(15) NOT NULL; +create domain dnull varchar(15); +create domain dcheck varchar(15) NOT NULL CHECK (VALUE = 'a' OR VALUE = 'c' OR VALUE = 'd'); +create table nulltest + ( col1 dnotnull + , col2 dnotnull NULL -- NOT NULL in the domain cannot be overridden + , col3 dnull NOT NULL + , col4 dnull + , col5 dcheck CHECK (col5 IN ('c', 'd')) + ); +INSERT INTO nulltest DEFAULT VALUES; +ERROR: domain dnotnull does not allow null values +INSERT INTO nulltest values ('a', 'b', 'c', 'd', 'c'); -- Good +insert into nulltest values ('a', 'b', 'c', 'd', NULL); +ERROR: domain dcheck does not allow null values +insert into nulltest values ('a', 'b', 'c', 'd', 'a'); +ERROR: new row for relation "nulltest" violates check constraint "nulltest_col5_check" +INSERT INTO nulltest values (NULL, 'b', 'c', 'd', 'd'); +ERROR: domain dnotnull does not allow null values +INSERT INTO nulltest values ('a', NULL, 'c', 'd', 'c'); +ERROR: domain dnotnull does not allow null values +INSERT INTO nulltest values ('a', 'b', NULL, 'd', 'c'); +ERROR: null value in column "col3" violates not-null constraint +INSERT INTO nulltest values ('a', 'b', 'c', NULL, 'd'); -- Good +-- Test copy +COPY nulltest FROM stdin; --fail +ERROR: Error while running COPY +COPY nulltest FROM stdin; --fail +ERROR: domain dcheck does not allow null values +CONTEXT: COPY nulltest, line 1, column col5: null input +-- Last row is bad +COPY nulltest FROM stdin; +ERROR: Error while running COPY +select * from nulltest order by 1, 2, 3, 4, 5; + col1 | col2 | col3 | col4 | col5 +------+------+------+------+------ + a | b | c | d | c + a | b | c | | d +(2 rows) + +-- Test out coerced (casted) constraints +SELECT cast('1' as dnotnull); + dnotnull +---------- + 1 +(1 row) + +SELECT cast(NULL as dnotnull); -- fail +ERROR: domain dnotnull does not allow null values +SELECT cast(cast(NULL as dnull) as dnotnull); -- fail +ERROR: domain dnotnull does not allow null values +SELECT cast(col4 as dnotnull) from nulltest; -- fail +ERROR: domain dnotnull does not allow null values +-- cleanup +drop table nulltest; +drop domain dnotnull restrict; +drop domain dnull restrict; +drop domain dcheck restrict; +create domain ddef1 int4 DEFAULT 3; +create domain ddef2 oid DEFAULT '12'; +-- Type mixing, function returns int8 +create domain ddef3 text DEFAULT 5; +create sequence ddef4_seq; +create domain ddef4 int4 DEFAULT nextval('ddef4_seq'); +ERROR: Postgres-XC does not support DEFAULT with non-immutable functions yet +DETAIL: The feature is not currently supported +create domain ddef5 numeric(8,2) NOT NULL DEFAULT '12.12'; +create table defaulttest + ( col1 ddef1 + , col2 ddef2 + , col3 ddef3 + , col4 ddef4 PRIMARY KEY + , col5 ddef1 NOT NULL DEFAULT NULL + , col6 ddef2 DEFAULT '88' + , col7 ddef4 DEFAULT 8000 + , col8 ddef5 + ); +ERROR: type "ddef4" does not exist +LINE 5: , col4 ddef4 PRIMARY KEY + ^ +insert into defaulttest(col4) values(0); -- fails, col5 defaults to null +ERROR: relation "defaulttest" does not exist +LINE 1: insert into defaulttest(col4) values(0); + ^ +alter table defaulttest alter column col5 drop default; +ERROR: relation "defaulttest" does not exist +insert into defaulttest default values; -- succeeds, inserts domain default +ERROR: relation "defaulttest" does not exist +LINE 1: insert into defaulttest default values; + ^ +-- We used to treat SET DEFAULT NULL as equivalent to DROP DEFAULT; wrong +alter table defaulttest alter column col5 set default null; +ERROR: relation "defaulttest" does not exist +insert into defaulttest(col4) values(0); -- fails +ERROR: relation "defaulttest" does not exist +LINE 1: insert into defaulttest(col4) values(0); + ^ +alter table defaulttest alter column col5 drop default; +ERROR: relation "defaulttest" does not exist +insert into defaulttest default values; +ERROR: relation "defaulttest" does not exist +LINE 1: insert into defaulttest default values; + ^ +insert into defaulttest default values; +ERROR: relation "defaulttest" does not exist +LINE 1: insert into defaulttest default values; + ^ +-- Test defaults with copy +COPY defaulttest(col5) FROM stdin; +ERROR: relation "defaulttest" does not exist +42 +\. +invalid command \. +select * from defaulttest order by 1,2,3,4,5,6,7,8; +ERROR: syntax error at or near "42" +LINE 1: 42 + ^ +drop table defaulttest cascade; +ERROR: table "defaulttest" does not exist +-- Test ALTER DOMAIN .. NOT NULL +create domain dnotnulltest integer; +create table domnotnull +( col1 dnotnulltest +, col2 dnotnulltest +); +insert into domnotnull default values; +alter domain dnotnulltest set not null; -- fails +ERROR: column "col1" of table "domnotnull" contains null values +update domnotnull set col1 = 5; +alter domain dnotnulltest set not null; -- fails +ERROR: column "col2" of table "domnotnull" contains null values +update domnotnull set col2 = 6; +alter domain dnotnulltest set not null; +update domnotnull set col1 = null; -- fails +ERROR: domain dnotnulltest does not allow null values +alter domain dnotnulltest drop not null; +update domnotnull set col1 = null; +drop domain dnotnulltest cascade; +NOTICE: drop cascades to 2 other objects +DETAIL: drop cascades to table domnotnull column col1 +drop cascades to table domnotnull column col2 +-- Test ALTER DOMAIN .. DEFAULT .. +create table domdeftest (col1 ddef1); +insert into domdeftest default values; +select * from domdeftest order by 1; + col1 +------ + 3 +(1 row) + +alter domain ddef1 set default '42'; +insert into domdeftest default values; +select * from domdeftest order by 1; + col1 +------ + 3 + 42 +(2 rows) + +alter domain ddef1 drop default; +insert into domdeftest default values; +select * from domdeftest order by 1; + col1 +------ + 3 + 42 + +(3 rows) + +drop table domdeftest; +-- Test ALTER DOMAIN .. CONSTRAINT .. +create domain con as integer; +create table domcontest (col1 con); +insert into domcontest values (1); +insert into domcontest values (2); +alter domain con add constraint t check (VALUE < 1); -- fails +ERROR: column "col1" of table "domcontest" contains values that violate the new constraint +alter domain con add constraint t check (VALUE < 34); +alter domain con add check (VALUE > 0); +insert into domcontest values (-5); -- fails +ERROR: value for domain con violates check constraint "con_check" +insert into domcontest values (42); -- fails +ERROR: value for domain con violates check constraint "t" +insert into domcontest values (5); +alter domain con drop constraint t; +insert into domcontest values (-5); --fails +ERROR: value for domain con violates check constraint "con_check" +insert into domcontest values (42); +-- Confirm ALTER DOMAIN with RULES. +create table domtab (col1 integer); +create domain dom as integer; +create view domview as select cast(col1 as dom) from domtab; +insert into domtab (col1) values (null); +insert into domtab (col1) values (5); +select * from domview order by 1; + col1 +------ + 5 + +(2 rows) + +alter domain dom set not null; +select * from domview; -- fail +ERROR: domain dom does not allow null values +alter domain dom drop not null; +select * from domview order by 1; + col1 +------ + 5 + +(2 rows) + +alter domain dom add constraint domchkgt6 check(value > 6); +select * from domview; --fail +ERROR: value for domain dom violates check constraint "domchkgt6" +alter domain dom drop constraint domchkgt6 restrict; +select * from domview order by 1; + col1 +------ + 5 + +(2 rows) + +-- cleanup +drop domain ddef1 restrict; +drop domain ddef2 restrict; +drop domain ddef3 restrict; +drop domain ddef4 restrict; +ERROR: type "ddef4" does not exist +drop domain ddef5 restrict; +drop sequence ddef4_seq; +-- Test domains over domains +create domain vchar4 varchar(4); +create domain dinter vchar4 check (substring(VALUE, 1, 1) = 'x'); +create domain dtop dinter check (substring(VALUE, 2, 1) = '1'); +select 'x123'::dtop; + dtop +------ + x123 +(1 row) + +select 'x1234'::dtop; -- explicit coercion should truncate + dtop +------ + x123 +(1 row) + +select 'y1234'::dtop; -- fail +ERROR: value for domain dtop violates check constraint "dinter_check" +select 'y123'::dtop; -- fail +ERROR: value for domain dtop violates check constraint "dinter_check" +select 'yz23'::dtop; -- fail +ERROR: value for domain dtop violates check constraint "dinter_check" +select 'xz23'::dtop; -- fail +ERROR: value for domain dtop violates check constraint "dtop_check" +create temp table dtest(f1 dtop); +ERROR: PG-XC does not yet support temporary tables +insert into dtest values('x123'); +ERROR: relation "dtest" does not exist +LINE 1: insert into dtest values('x123'); + ^ +insert into dtest values('x1234'); -- fail, implicit coercion +ERROR: relation "dtest" does not exist +LINE 1: insert into dtest values('x1234'); + ^ +insert into dtest values('y1234'); -- fail, implicit coercion +ERROR: relation "dtest" does not exist +LINE 1: insert into dtest values('y1234'); + ^ +insert into dtest values('y123'); -- fail +ERROR: relation "dtest" does not exist +LINE 1: insert into dtest values('y123'); + ^ +insert into dtest values('yz23'); -- fail +ERROR: relation "dtest" does not exist +LINE 1: insert into dtest values('yz23'); + ^ +insert into dtest values('xz23'); -- fail +ERROR: relation "dtest" does not exist +LINE 1: insert into dtest values('xz23'); + ^ +drop table dtest; +ERROR: table "dtest" does not exist +drop domain vchar4 cascade; +NOTICE: drop cascades to 2 other objects +DETAIL: drop cascades to type dinter +drop cascades to type dtop +-- Make sure that constraints of newly-added domain columns are +-- enforced correctly, even if there's no default value for the new +-- column. Per bug #1433 +create domain str_domain as text not null; +create table domain_test (a int, b int); +insert into domain_test values (1, 2); +insert into domain_test values (1, 2); +-- should fail +alter table domain_test add column c str_domain; +ERROR: domain str_domain does not allow null values +create domain str_domain2 as text check (value <> 'foo') default 'foo'; +-- should fail +alter table domain_test add column d str_domain2; +ERROR: value for domain str_domain2 violates check constraint "str_domain2_check" +-- Check that domain constraints on prepared statement parameters of +-- unknown type are enforced correctly. +create domain pos_int as int4 check (value > 0) not null; +prepare s1 as select $1::pos_int = 10 as "is_ten"; +ERROR: Postgres-XC does not support PREPARE yet +DETAIL: The feature is not currently supported +execute s1(10); +ERROR: Postgres-XC does not support EXECUTE yet +DETAIL: The feature is not currently supported +execute s1(0); -- should fail +ERROR: Postgres-XC does not support EXECUTE yet +DETAIL: The feature is not currently supported +execute s1(NULL); -- should fail +ERROR: Postgres-XC does not support EXECUTE yet +DETAIL: The feature is not currently supported +-- Check that domain constraints on plpgsql function parameters, results, +-- and local variables are enforced correctly. +create function doubledecrement(p1 pos_int) returns pos_int as $$ +declare v pos_int; +begin + return p1; +end$$ language plpgsql; +select doubledecrement(3); -- fail because of implicit null assignment +ERROR: domain pos_int does not allow null values +CONTEXT: PL/pgSQL function "doubledecrement" line 2 during statement block local variable initialization +create or replace function doubledecrement(p1 pos_int) returns pos_int as $$ +declare v pos_int := 0; +begin + return p1; +end$$ language plpgsql; +select doubledecrement(3); -- fail at initialization assignment +ERROR: value for domain pos_int violates check constraint "pos_int_check" +CONTEXT: PL/pgSQL function "doubledecrement" line 2 during statement block local variable initialization +create or replace function doubledecrement(p1 pos_int) returns pos_int as $$ +declare v pos_int := 1; +begin + v := p1 - 1; + return v - 1; +end$$ language plpgsql; +select doubledecrement(null); -- fail before call +ERROR: domain pos_int does not allow null values +select doubledecrement(0); -- fail before call +ERROR: value for domain pos_int violates check constraint "pos_int_check" +select doubledecrement(1); -- fail at assignment to v +ERROR: value for domain pos_int violates check constraint "pos_int_check" +CONTEXT: PL/pgSQL function "doubledecrement" line 3 at assignment +select doubledecrement(2); -- fail at return +ERROR: value for domain pos_int violates check constraint "pos_int_check" +CONTEXT: PL/pgSQL function "doubledecrement" while casting return value to function's return type +select doubledecrement(3); -- good + doubledecrement +----------------- + 1 +(1 row) + +-- Check that ALTER DOMAIN tests columns of derived types +create domain posint as int4; +-- Currently, this doesn't work for composite types, but verify it complains +create type ddtest1 as (f1 posint); +create table ddtest2(f1 ddtest1); +insert into ddtest2 values(row(-1)); +alter domain posint add constraint c1 check(value >= 0); +ERROR: cannot alter type "posint" because column "ddtest2"."f1" uses it +drop table ddtest2; +create table ddtest2(f1 ddtest1[]); +insert into ddtest2 values('{(-1)}'); +alter domain posint add constraint c1 check(value >= 0); +ERROR: cannot alter type "posint" because column "ddtest2"."f1" uses it +drop table ddtest2; +alter domain posint add constraint c1 check(value >= 0); +create domain posint2 as posint check (value % 2 = 0); +create table ddtest2(f1 posint2); +insert into ddtest2 values(11); -- fail +ERROR: value for domain posint2 violates check constraint "posint2_check" +insert into ddtest2 values(-2); -- fail +ERROR: value for domain posint2 violates check constraint "c1" +insert into ddtest2 values(2); +alter domain posint add constraint c2 check(value >= 10); -- fail +ERROR: column "f1" of table "ddtest2" contains values that violate the new constraint +alter domain posint add constraint c2 check(value > 0); -- OK +drop table ddtest2; +drop type ddtest1; +drop domain posint cascade; +NOTICE: drop cascades to type posint2 diff --git a/src/test/regress/sql/domain.sql b/src/test/regress/sql/domain.sql index d14edb4..8df44fa 100644 --- a/src/test/regress/sql/domain.sql +++ b/src/test/regress/sql/domain.sql @@ -56,7 +56,7 @@ select * from basictest order by 1, 2, 3, 4; -- check that domains inherit operations from base types select testtext || testvarchar as concat, testnumeric + 42 as sum -from basictest; +from basictest order by 1,2; -- check that union/case/coalesce type resolution handles domains properly select coalesce(4::domainint4, 7) is of (int4) as t; @@ -221,7 +221,7 @@ drop domain dnotnulltest cascade; create table domdeftest (col1 ddef1); insert into domdeftest default values; -select * from domdeftest; +select * from domdeftest order by 1; alter domain ddef1 set default '42'; insert into domdeftest default values; @@ -229,7 +229,7 @@ select * from domdeftest order by 1; alter domain ddef1 drop default; insert into domdeftest default values; -select * from domdeftest; +select * from domdeftest order by 1; drop table domdeftest; ----------------------------------------------------------------------- Summary of changes: .../regress/expected/{domain.out => domain_1.out} | 95 +++++++++++++------ src/test/regress/sql/domain.sql | 6 +- 2 files changed, 68 insertions(+), 33 deletions(-) copy src/test/regress/expected/{domain.out => domain_1.out} (87%) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-04-12 02:45:46
|
Project "Postgres-XC". The branch, master has been updated via b17fd66a279122e8cb26fd6e7b557b212c26a10d (commit) from 48d58f472b2b3f6c1a15601d6ee413a0ae17ca3d (commit) - Log ----------------------------------------------------------------- commit b17fd66a279122e8cb26fd6e7b557b212c26a10d Author: Michael P <mic...@us...> Date: Tue Apr 12 11:40:13 2011 +0900 Fix for regression test errors In Postgres-XC, aggregate ctype has to be specified when creating an aggregate function, so this output is correct. diff --git a/src/test/regress/expected/errors_1.out b/src/test/regress/expected/errors_1.out new file mode 100644 index 0000000..a0c69da --- /dev/null +++ b/src/test/regress/expected/errors_1.out @@ -0,0 +1,466 @@ +-- +-- ERRORS +-- +-- bad in postquel, but ok in postsql +select 1; + ?column? +---------- + 1 +(1 row) + +-- +-- UNSUPPORTED STUFF + +-- doesn't work +-- notify pg_class +-- +-- +-- SELECT + +-- missing relation name +select; +ERROR: syntax error at or near ";" +LINE 1: select; + ^ +-- no such relation +select * from nonesuch; +ERROR: relation "nonesuch" does not exist +LINE 1: select * from nonesuch; + ^ +-- missing target list +select from pg_database; +ERROR: syntax error at or near "from" +LINE 1: select from pg_database; + ^ +-- bad name in target list +select nonesuch from pg_database; +ERROR: column "nonesuch" does not exist +LINE 1: select nonesuch from pg_database; + ^ +-- bad attribute name on lhs of operator +select * from pg_database where nonesuch = pg_database.datname; +ERROR: column "nonesuch" does not exist +LINE 1: select * from pg_database where nonesuch = pg_database.datna... + ^ +-- bad attribute name on rhs of operator +select * from pg_database where pg_database.datname = nonesuch; +ERROR: column "nonesuch" does not exist +LINE 1: ...ect * from pg_database where pg_database.datname = nonesuch; + ^ +-- bad select distinct on syntax, distinct attribute missing +select distinct on (foobar) from pg_database; +ERROR: syntax error at or near "from" +LINE 1: select distinct on (foobar) from pg_database; + ^ +-- bad select distinct on syntax, distinct attribute not in target list +select distinct on (foobar) * from pg_database; +ERROR: column "foobar" does not exist +LINE 1: select distinct on (foobar) * from pg_database; + ^ +-- +-- DELETE + +-- missing relation name (this had better not wildcard!) +delete from; +ERROR: syntax error at or near ";" +LINE 1: delete from; + ^ +-- no such relation +delete from nonesuch; +ERROR: relation "nonesuch" does not exist +LINE 1: delete from nonesuch; + ^ +-- +-- DROP + +-- missing relation name (this had better not wildcard!) +drop table; +ERROR: syntax error at or near ";" +LINE 1: drop table; + ^ +-- no such relation +drop table nonesuch; +ERROR: table "nonesuch" does not exist +-- +-- ALTER TABLE + +-- relation renaming +-- missing relation name +alter table rename; +ERROR: syntax error at or near ";" +LINE 1: alter table rename; + ^ +-- no such relation +alter table nonesuch rename to newnonesuch; +ERROR: relation "nonesuch" does not exist +-- no such relation +alter table nonesuch rename to stud_emp; +ERROR: relation "nonesuch" does not exist +-- conflict +alter table stud_emp rename to aggtest; +ERROR: relation "aggtest" already exists +-- self-conflict +alter table stud_emp rename to stud_emp; +ERROR: relation "stud_emp" already exists +-- attribute renaming +-- no such relation +alter table nonesuchrel rename column nonesuchatt to newnonesuchatt; +ERROR: relation "nonesuchrel" does not exist +-- no such attribute +alter table emp rename column nonesuchatt to newnonesuchatt; +ERROR: column "nonesuchatt" does not exist +-- conflict +alter table emp rename column salary to manager; +ERROR: column "manager" of relation "stud_emp" already exists +-- conflict +alter table emp rename column salary to oid; +ERROR: column "oid" of relation "stud_emp" already exists +-- +-- TRANSACTION STUFF + +-- not in a xact +abort; +NOTICE: there is no transaction in progress +-- not in a xact +end; +WARNING: there is no transaction in progress +-- +-- CREATE AGGREGATE +-- sfunc/finalfunc type disagreement +create aggregate newavg2 (sfunc = int4pl, + basetype = int4, + stype = int4, + finalfunc = int2um, + initcond = '0'); +ERROR: aggregate ctype must be specified +-- left out basetype +create aggregate newcnt1 (sfunc = int4inc, + stype = int4, + initcond = '0'); +ERROR: aggregate ctype must be specified +-- +-- DROP INDEX + +-- missing index name +drop index; +ERROR: syntax error at or near ";" +LINE 1: drop index; + ^ +-- bad index name +drop index 314159; +ERROR: syntax error at or near "314159" +LINE 1: drop index 314159; + ^ +-- no such index +drop index nonesuch; +ERROR: index "nonesuch" does not exist +-- +-- DROP AGGREGATE + +-- missing aggregate name +drop aggregate; +ERROR: syntax error at or near ";" +LINE 1: drop aggregate; + ^ +-- missing aggregate type +drop aggregate newcnt1; +ERROR: syntax error at or near ";" +LINE 1: drop aggregate newcnt1; + ^ +-- bad aggregate name +drop aggregate 314159 (int); +ERROR: syntax error at or near "314159" +LINE 1: drop aggregate 314159 (int); + ^ +-- bad aggregate type +drop aggregate newcnt (nonesuch); +ERROR: type "nonesuch" does not exist +-- no such aggregate +drop aggregate nonesuch (int4); +ERROR: aggregate nonesuch(integer) does not exist +-- no such aggregate for type +drop aggregate newcnt (float4); +ERROR: aggregate newcnt(real) does not exist +-- +-- DROP FUNCTION + +-- missing function name +drop function (); +ERROR: syntax error at or near "(" +LINE 1: drop function (); + ^ +-- bad function name +drop function 314159(); +ERROR: syntax error at or near "314159" +LINE 1: drop function 314159(); + ^ +-- no such function +drop function nonesuch(); +ERROR: function nonesuch() does not exist +-- +-- DROP TYPE + +-- missing type name +drop type; +ERROR: syntax error at or near ";" +LINE 1: drop type; + ^ +-- bad type name +drop type 314159; +ERROR: syntax error at or near "314159" +LINE 1: drop type 314159; + ^ +-- no such type +drop type nonesuch; +ERROR: type "nonesuch" does not exist +-- +-- DROP OPERATOR + +-- missing everything +drop operator; +ERROR: syntax error at or near ";" +LINE 1: drop operator; + ^ +-- bad operator name +drop operator equals; +ERROR: syntax error at or near ";" +LINE 1: drop operator equals; + ^ +-- missing type list +drop operator ===; +ERROR: syntax error at or near ";" +LINE 1: drop operator ===; + ^ +-- missing parentheses +drop operator int4, int4; +ERROR: syntax error at or near "," +LINE 1: drop operator int4, int4; + ^ +-- missing operator name +drop operator (int4, int4); +ERROR: syntax error at or near "(" +LINE 1: drop operator (int4, int4); + ^ +-- missing type list contents +drop operator === (); +ERROR: syntax error at or near ")" +LINE 1: drop operator === (); + ^ +-- no such operator +drop operator === (int4); +ERROR: missing argument +LINE 1: drop operator === (int4); + ^ +HINT: Use NONE to denote the missing argument of a unary operator. +-- no such operator by that name +drop operator === (int4, int4); +ERROR: operator does not exist: integer === integer +-- no such type1 +drop operator = (nonesuch); +ERROR: missing argument +LINE 1: drop operator = (nonesuch); + ^ +HINT: Use NONE to denote the missing argument of a unary operator. +-- no such type1 +drop operator = ( , int4); +ERROR: syntax error at or near "," +LINE 1: drop operator = ( , int4); + ^ +-- no such type1 +drop operator = (nonesuch, int4); +ERROR: type "nonesuch" does not exist +-- no such type2 +drop operator = (int4, nonesuch); +ERROR: type "nonesuch" does not exist +-- no such type2 +drop operator = (int4, ); +ERROR: syntax error at or near ")" +LINE 1: drop operator = (int4, ); + ^ +-- +-- DROP RULE + +-- missing rule name +drop rule; +ERROR: syntax error at or near ";" +LINE 1: drop rule; + ^ +-- bad rule name +drop rule 314159; +ERROR: syntax error at or near "314159" +LINE 1: drop rule 314159; + ^ +-- no such rule +drop rule nonesuch on noplace; +ERROR: relation "noplace" does not exist +-- these postquel variants are no longer supported +drop tuple rule nonesuch; +ERROR: syntax error at or near "tuple" +LINE 1: drop tuple rule nonesuch; + ^ +drop instance rule nonesuch on noplace; +ERROR: syntax error at or near "instance" +LINE 1: drop instance rule nonesuch on noplace; + ^ +drop rewrite rule nonesuch; +ERROR: syntax error at or near "rewrite" +LINE 1: drop rewrite rule nonesuch; + ^ +-- +-- Check that division-by-zero is properly caught. +-- +select 1/0; +ERROR: division by zero +select 1::int8/0; +ERROR: division by zero +select 1/0::int8; +ERROR: division by zero +select 1::int2/0; +ERROR: division by zero +select 1/0::int2; +ERROR: division by zero +select 1::numeric/0; +ERROR: division by zero +select 1/0::numeric; +ERROR: division by zero +select 1::float8/0; +ERROR: division by zero +select 1/0::float8; +ERROR: division by zero +select 1::float4/0; +ERROR: division by zero +select 1/0::float4; +ERROR: division by zero +-- +-- Test psql's reporting of syntax error location +-- +xxx; +ERROR: syntax error at or near "xxx" +LINE 1: xxx; + ^ +CREATE foo; +ERROR: syntax error at or near "foo" +LINE 1: CREATE foo; + ^ +CREATE TABLE ; +ERROR: syntax error at or near ";" +LINE 1: CREATE TABLE ; + ^ +CREATE TABLE +\g +ERROR: syntax error at end of input +LINE 1: CREATE TABLE + ^ +INSERT INTO foo VALUES(123) foo; +ERROR: syntax error at or near "foo" +LINE 1: INSERT INTO foo VALUES(123) foo; + ^ +INSERT INTO 123 +VALUES(123); +ERROR: syntax error at or near "123" +LINE 1: INSERT INTO 123 + ^ +INSERT INTO foo +VALUES(123) 123 +; +ERROR: syntax error at or near "123" +LINE 2: VALUES(123) 123 + ^ +-- with a tab +CREATE TABLE foo + (id INT4 UNIQUE NOT NULL, id2 TEXT NOT NULL PRIMARY KEY, + id3 INTEGER NOT NUL, + id4 INT4 UNIQUE NOT NULL, id5 TEXT UNIQUE NOT NULL); +ERROR: syntax error at or near "NUL" +LINE 3: id3 INTEGER NOT NUL, + ^ +-- long line to be truncated on the left +CREATE TABLE foo(id INT4 UNIQUE NOT NULL, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL, +id4 INT4 UNIQUE NOT NULL, id5 TEXT UNIQUE NOT NULL); +ERROR: syntax error at or near "NUL" +LINE 1: ...T NULL, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL, + ^ +-- long line to be truncated on the right +CREATE TABLE foo( +id3 INTEGER NOT NUL, id4 INT4 UNIQUE NOT NULL, id5 TEXT UNIQUE NOT NULL, id INT4 UNIQUE NOT NULL, id2 TEXT NOT NULL PRIMARY KEY); +ERROR: syntax error at or near "NUL" +LINE 2: id3 INTEGER NOT NUL, id4 INT4 UNIQUE NOT NULL, id5 TEXT UNIQ... + ^ +-- long line to be truncated both ways +CREATE TABLE foo(id INT4 UNIQUE NOT NULL, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL, id4 INT4 UNIQUE NOT NULL, id5 TEXT UNIQUE NOT NULL); +ERROR: syntax error at or near "NUL" +LINE 1: ...L, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL, id4 I... + ^ +-- long line to be truncated on the left, many lines +CREATE +TEMPORARY +TABLE +foo(id INT4 UNIQUE NOT NULL, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL, +id4 INT4 +UNIQUE +NOT +NULL, +id5 TEXT +UNIQUE +NOT +NULL) +; +ERROR: syntax error at or near "NUL" +LINE 4: ...T NULL, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL, + ^ +-- long line to be truncated on the right, many lines +CREATE +TEMPORARY +TABLE +foo( +id3 INTEGER NOT NUL, id4 INT4 UNIQUE NOT NULL, id5 TEXT UNIQUE NOT NULL, id INT4 UNIQUE NOT NULL, id2 TEXT NOT NULL PRIMARY KEY) +; +ERROR: syntax error at or near "NUL" +LINE 5: id3 INTEGER NOT NUL, id4 INT4 UNIQUE NOT NULL, id5 TEXT UNIQ... + ^ +-- long line to be truncated both ways, many lines +CREATE +TEMPORARY +TABLE +foo +(id +INT4 +UNIQUE NOT NULL, idx INT4 UNIQUE NOT NULL, idy INT4 UNIQUE NOT NULL, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL, id4 INT4 UNIQUE NOT NULL, id5 TEXT UNIQUE NOT NULL, +idz INT4 UNIQUE NOT NULL, +idv INT4 UNIQUE NOT NULL); +ERROR: syntax error at or near "NUL" +LINE 7: ...L, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL, id4 I... + ^ +-- more than 10 lines... +CREATE +TEMPORARY +TABLE +foo +(id +INT4 +UNIQUE +NOT +NULL +, +idm +INT4 +UNIQUE +NOT +NULL, +idx INT4 UNIQUE NOT NULL, idy INT4 UNIQUE NOT NULL, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL, id4 INT4 UNIQUE NOT NULL, id5 TEXT UNIQUE NOT NULL, +idz INT4 UNIQUE NOT NULL, +idv +INT4 +UNIQUE +NOT +NULL); +ERROR: syntax error at or near "NUL" +LINE 16: ...L, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL, id4 I... + ^ +-- Check that stack depth detection mechanism works and +-- max_stack_depth is not set too high +create function infinite_recurse() returns int as +'select infinite_recurse()' language sql; +\set VERBOSITY terse +select infinite_recurse(); +ERROR: stack depth limit exceeded ----------------------------------------------------------------------- Summary of changes: .../regress/expected/{errors.out => errors_1.out} | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) copy src/test/regress/expected/{errors.out => errors_1.out} (99%) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-04-12 02:41:53
|
Project "Postgres-XC". The branch, master has been updated via 48d58f472b2b3f6c1a15601d6ee413a0ae17ca3d (commit) from 2cd2aaa6dc83b46c296aa40331ef2d28243aea93 (commit) - Log ----------------------------------------------------------------- commit 48d58f472b2b3f6c1a15601d6ee413a0ae17ca3d Author: Michael P <mic...@us...> Date: Tue Apr 12 11:37:33 2011 +0900 Fix for regression test create_view TEMP views and INTO clause are not yet supported by XC, so this output is correct. diff --git a/src/test/regress/expected/create_view_1.out b/src/test/regress/expected/create_view_1.out new file mode 100644 index 0000000..590845d --- /dev/null +++ b/src/test/regress/expected/create_view_1.out @@ -0,0 +1,295 @@ +-- +-- CREATE_VIEW +-- Virtual class definitions +-- (this also tests the query rewrite system) +-- +CREATE VIEW street AS + SELECT r.name, r.thepath, c.cname AS cname + FROM ONLY road r, real_city c + WHERE c.outline ## r.thepath; +CREATE VIEW iexit AS + SELECT ih.name, ih.thepath, + interpt_pp(ih.thepath, r.thepath) AS exit + FROM ihighway ih, ramp r + WHERE ih.thepath ## r.thepath; +ERROR: relation "ramp" does not exist +LINE 4: FROM ihighway ih, ramp r + ^ +CREATE VIEW toyemp AS + SELECT name, age, location, 12*salary AS annualsal + FROM emp; +-- Test comments +COMMENT ON VIEW noview IS 'no view'; +ERROR: relation "noview" does not exist +COMMENT ON VIEW toyemp IS 'is a view'; +COMMENT ON VIEW toyemp IS NULL; +-- +-- CREATE OR REPLACE VIEW +-- +CREATE TABLE viewtest_tbl (a int, b int); +COPY viewtest_tbl FROM stdin; +CREATE OR REPLACE VIEW viewtest AS + SELECT * FROM viewtest_tbl; +CREATE OR REPLACE VIEW viewtest AS + SELECT * FROM viewtest_tbl WHERE a > 10; +SELECT * FROM viewtest ORDER BY a; + a | b +----+---- + 15 | 20 + 20 | 25 +(2 rows) + +CREATE OR REPLACE VIEW viewtest AS + SELECT a, b FROM viewtest_tbl WHERE a > 5 ORDER BY b DESC; +SELECT * FROM viewtest ORDER BY a; + a | b +----+---- + 10 | 15 + 15 | 20 + 20 | 25 +(3 rows) + +-- should fail +CREATE OR REPLACE VIEW viewtest AS + SELECT a FROM viewtest_tbl WHERE a <> 20; +ERROR: cannot drop columns from view +-- should fail +CREATE OR REPLACE VIEW viewtest AS + SELECT 1, * FROM viewtest_tbl; +ERROR: cannot change name of view column "a" to "?column?" +-- should fail +CREATE OR REPLACE VIEW viewtest AS + SELECT a, b::numeric FROM viewtest_tbl; +ERROR: cannot change data type of view column "b" from integer to numeric +-- should work +CREATE OR REPLACE VIEW viewtest AS + SELECT a, b, 0 AS c FROM viewtest_tbl; +DROP VIEW viewtest; +DROP TABLE viewtest_tbl; +-- tests for temporary views +CREATE SCHEMA temp_view_test + CREATE TABLE base_table (a int, id int) + CREATE TABLE base_table2 (a int, id int); +SET search_path TO temp_view_test, public; +CREATE TEMPORARY TABLE temp_table (a int, id int); +ERROR: PG-XC does not yet support temporary tables +-- should be created in temp_view_test schema +CREATE VIEW v1 AS SELECT * FROM base_table; +-- should be created in temp object schema +CREATE VIEW v1_temp AS SELECT * FROM temp_table; +ERROR: relation "temp_table" does not exist +LINE 1: CREATE VIEW v1_temp AS SELECT * FROM temp_table; + ^ +-- should be created in temp object schema +CREATE TEMP VIEW v2_temp AS SELECT * FROM base_table; +ERROR: PG-XC does not yet support temporary tables +-- should be created in temp_views schema +CREATE VIEW temp_view_test.v2 AS SELECT * FROM base_table; +-- should fail +CREATE VIEW temp_view_test.v3_temp AS SELECT * FROM temp_table; +ERROR: relation "temp_table" does not exist +LINE 1: ...EATE VIEW temp_view_test.v3_temp AS SELECT * FROM temp_table... + ^ +-- should fail +CREATE SCHEMA test_schema + CREATE TEMP VIEW testview AS SELECT 1; +ERROR: temporary tables cannot specify a schema name +-- joins: if any of the join relations are temporary, the view +-- should also be temporary +-- should be non-temp +CREATE VIEW v3 AS + SELECT t1.a AS t1_a, t2.a AS t2_a + FROM base_table t1, base_table2 t2 + WHERE t1.id = t2.id; +-- should be temp (one join rel is temp) +CREATE VIEW v4_temp AS + SELECT t1.a AS t1_a, t2.a AS t2_a + FROM base_table t1, temp_table t2 + WHERE t1.id = t2.id; +ERROR: relation "temp_table" does not exist +LINE 3: FROM base_table t1, temp_table t2 + ^ +-- should be temp +CREATE VIEW v5_temp AS + SELECT t1.a AS t1_a, t2.a AS t2_a, t3.a AS t3_a + FROM base_table t1, base_table2 t2, temp_table t3 + WHERE t1.id = t2.id and t2.id = t3.id; +ERROR: relation "temp_table" does not exist +LINE 3: FROM base_table t1, base_table2 t2, temp_table t3 + ^ +-- subqueries +CREATE VIEW v4 AS SELECT * FROM base_table WHERE id IN (SELECT id FROM base_table2); +CREATE VIEW v5 AS SELECT t1.id, t2.a FROM base_table t1, (SELECT * FROM base_table2) t2; +CREATE VIEW v6 AS SELECT * FROM base_table WHERE EXISTS (SELECT 1 FROM base_table2); +CREATE VIEW v7 AS SELECT * FROM base_table WHERE NOT EXISTS (SELECT 1 FROM base_table2); +CREATE VIEW v8 AS SELECT * FROM base_table WHERE EXISTS (SELECT 1); +CREATE VIEW v6_temp AS SELECT * FROM base_table WHERE id IN (SELECT id FROM temp_table); +ERROR: relation "temp_table" does not exist +LINE 1: ...ECT * FROM base_table WHERE id IN (SELECT id FROM temp_table... + ^ +CREATE VIEW v7_temp AS SELECT t1.id, t2.a FROM base_table t1, (SELECT * FROM temp_table) t2; +ERROR: relation "temp_table" does not exist +LINE 1: ...CT t1.id, t2.a FROM base_table t1, (SELECT * FROM temp_table... + ^ +CREATE VIEW v8_temp AS SELECT * FROM base_table WHERE EXISTS (SELECT 1 FROM temp_table); +ERROR: relation "temp_table" does not exist +LINE 1: ...ECT * FROM base_table WHERE EXISTS (SELECT 1 FROM temp_table... + ^ +CREATE VIEW v9_temp AS SELECT * FROM base_table WHERE NOT EXISTS (SELECT 1 FROM temp_table); +ERROR: relation "temp_table" does not exist +LINE 1: ...* FROM base_table WHERE NOT EXISTS (SELECT 1 FROM temp_table... + ^ +-- a view should also be temporary if it references a temporary view +CREATE VIEW v10_temp AS SELECT * FROM v7_temp; +ERROR: relation "v7_temp" does not exist +LINE 1: CREATE VIEW v10_temp AS SELECT * FROM v7_temp; + ^ +CREATE VIEW v11_temp AS SELECT t1.id, t2.a FROM base_table t1, v10_temp t2; +ERROR: relation "v10_temp" does not exist +LINE 1: ...11_temp AS SELECT t1.id, t2.a FROM base_table t1, v10_temp t... + ^ +CREATE VIEW v12_temp AS SELECT true FROM v11_temp; +ERROR: relation "v11_temp" does not exist +LINE 1: CREATE VIEW v12_temp AS SELECT true FROM v11_temp; + ^ +-- a view should also be temporary if it references a temporary sequence +CREATE SEQUENCE seq1; +CREATE TEMPORARY SEQUENCE seq1_temp; +ERROR: Postgres-XC does not support TEMPORARY SEQUENCE yet +DETAIL: The feature is not currently supported +CREATE VIEW v9 AS SELECT seq1.is_called FROM seq1; +CREATE VIEW v13_temp AS SELECT seq1_temp.is_called FROM seq1_temp; +ERROR: relation "seq1_temp" does not exist +LINE 1: ... VIEW v13_temp AS SELECT seq1_temp.is_called FROM seq1_temp; + ^ +SELECT relname FROM pg_class + WHERE relname LIKE 'v_' + AND relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = 'temp_view_test') + ORDER BY relname; + relname +--------- + v1 + v2 + v3 + v4 + v5 + v6 + v7 + v8 + v9 +(9 rows) + +SELECT relname FROM pg_class + WHERE relname LIKE 'v%' + AND relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname LIKE 'pg_temp%') + ORDER BY relname; + relname +--------- +(0 rows) + +CREATE SCHEMA testviewschm2; +SET search_path TO testviewschm2, public; +CREATE TABLE t1 (num int, name text); +CREATE TABLE t2 (num2 int, value text); +CREATE TEMP TABLE tt (num2 int, value text); +ERROR: PG-XC does not yet support temporary tables +CREATE VIEW nontemp1 AS SELECT * FROM t1 CROSS JOIN t2; +CREATE VIEW temporal1 AS SELECT * FROM t1 CROSS JOIN tt; +ERROR: relation "tt" does not exist +LINE 1: CREATE VIEW temporal1 AS SELECT * FROM t1 CROSS JOIN tt; + ^ +CREATE VIEW nontemp2 AS SELECT * FROM t1 INNER JOIN t2 ON t1.num = t2.num2; +CREATE VIEW temporal2 AS SELECT * FROM t1 INNER JOIN tt ON t1.num = tt.num2; +ERROR: relation "tt" does not exist +LINE 1: ...ATE VIEW temporal2 AS SELECT * FROM t1 INNER JOIN tt ON t1.n... + ^ +CREATE VIEW nontemp3 AS SELECT * FROM t1 LEFT JOIN t2 ON t1.num = t2.num2; +CREATE VIEW temporal3 AS SELECT * FROM t1 LEFT JOIN tt ON t1.num = tt.num2; +ERROR: relation "tt" does not exist +LINE 1: ...EATE VIEW temporal3 AS SELECT * FROM t1 LEFT JOIN tt ON t1.n... + ^ +CREATE VIEW nontemp4 AS SELECT * FROM t1 LEFT JOIN t2 ON t1.num = t2.num2 AND t2.value = 'xxx'; +CREATE VIEW temporal4 AS SELECT * FROM t1 LEFT JOIN tt ON t1.num = tt.num2 AND tt.value = 'xxx'; +ERROR: relation "tt" does not exist +LINE 1: ...EATE VIEW temporal4 AS SELECT * FROM t1 LEFT JOIN tt ON t1.n... + ^ +SELECT relname FROM pg_class + WHERE relname LIKE 'nontemp%' + AND relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = 'testviewschm2') + ORDER BY relname; + relname +---------- + nontemp1 + nontemp2 + nontemp3 + nontemp4 +(4 rows) + +SELECT relname FROM pg_class + WHERE relname LIKE 'temporal%' + AND relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname LIKE 'pg_temp%') + ORDER BY relname; + relname +--------- +(0 rows) + +CREATE TABLE tbl1 ( a int, b int); +CREATE TABLE tbl2 (c int, d int); +CREATE TABLE tbl3 (e int, f int); +CREATE TABLE tbl4 (g int, h int); +CREATE TEMP TABLE tmptbl (i int, j int); +ERROR: PG-XC does not yet support temporary tables +--Should be in testviewschm2 +CREATE VIEW pubview AS SELECT * FROM tbl1 WHERE tbl1.a +BETWEEN (SELECT d FROM tbl2 WHERE c = 1) AND (SELECT e FROM tbl3 WHERE f = 2) +AND EXISTS (SELECT g FROM tbl4 LEFT JOIN tbl3 ON tbl4.h = tbl3.f); +SELECT count(*) FROM pg_class where relname = 'pubview' +AND relnamespace IN (SELECT OID FROM pg_namespace WHERE nspname = 'testviewschm2'); + count +------- + 1 +(1 row) + +--Should be in temp object schema +CREATE VIEW mytempview AS SELECT * FROM tbl1 WHERE tbl1.a +BETWEEN (SELECT d FROM tbl2 WHERE c = 1) AND (SELECT e FROM tbl3 WHERE f = 2) +AND EXISTS (SELECT g FROM tbl4 LEFT JOIN tbl3 ON tbl4.h = tbl3.f) +AND NOT EXISTS (SELECT g FROM tbl4 LEFT JOIN tmptbl ON tbl4.h = tmptbl.j); +ERROR: relation "tmptbl" does not exist +LINE 4: AND NOT EXISTS (SELECT g FROM tbl4 LEFT JOIN tmptbl ON tbl4.... + ^ +SELECT count(*) FROM pg_class where relname LIKE 'mytempview' +And relnamespace IN (SELECT OID FROM pg_namespace WHERE nspname LIKE 'pg_temp%'); + count +------- + 0 +(1 row) + +DROP SCHEMA temp_view_test CASCADE; +NOTICE: drop cascades to 12 other objects +DETAIL: drop cascades to table temp_view_test.base_table +drop cascades to table temp_view_test.base_table2 +drop cascades to view temp_view_test.v1 +drop cascades to view temp_view_test.v2 +drop cascades to view temp_view_test.v3 +drop cascades to view temp_view_test.v4 +drop cascades to view temp_view_test.v5 +drop cascades to view temp_view_test.v6 +drop cascades to view temp_view_test.v7 +drop cascades to view temp_view_test.v8 +drop cascades to sequence temp_view_test.seq1 +drop cascades to view temp_view_test.v9 +DROP SCHEMA testviewschm2 CASCADE; +NOTICE: drop cascades to 11 other objects +DETAIL: drop cascades to table t1 +drop cascades to table t2 +drop cascades to view nontemp1 +drop cascades to view nontemp2 +drop cascades to view nontemp3 +drop cascades to view nontemp4 +drop cascades to table tbl1 +drop cascades to table tbl2 +drop cascades to table tbl3 +drop cascades to table tbl4 +drop cascades to view pubview +SET search_path to public; ----------------------------------------------------------------------- Summary of changes: .../{create_view.out => create_view_1.out} | 127 +++++++++++--------- 1 files changed, 69 insertions(+), 58 deletions(-) copy src/test/regress/expected/{create_view.out => create_view_1.out} (70%) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-04-12 02:15:07
|
Project "Postgres-XC". The branch, master has been updated via 2cd2aaa6dc83b46c296aa40331ef2d28243aea93 (commit) from ac25b331910b55892b3bfcecde7255471bd3622c (commit) - Log ----------------------------------------------------------------- commit 2cd2aaa6dc83b46c296aa40331ef2d28243aea93 Author: Michael P <mic...@us...> Date: Tue Apr 12 11:10:47 2011 +0900 Fix for regression test foreign_key TEMP tables, DEFERRED constraints, SAVEPOINT are not supported yet by Postgres-XC, so this output is correct. diff --git a/src/test/regress/expected/foreign_key_1.out b/src/test/regress/expected/foreign_key_1.out new file mode 100644 index 0000000..7eccdc6 --- /dev/null +++ b/src/test/regress/expected/foreign_key_1.out @@ -0,0 +1,1351 @@ +-- +-- FOREIGN KEY +-- +-- MATCH FULL +-- +-- First test, check and cascade +-- +CREATE TABLE PKTABLE ( ptest1 int PRIMARY KEY, ptest2 text ); +NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "pktable_pkey" for table "pktable" +CREATE TABLE FKTABLE ( ftest1 int REFERENCES PKTABLE MATCH FULL ON DELETE CASCADE ON UPDATE CASCADE, ftest2 int ); +-- Insert test data into PKTABLE +INSERT INTO PKTABLE VALUES (1, 'Test1'); +INSERT INTO PKTABLE VALUES (2, 'Test2'); +INSERT INTO PKTABLE VALUES (3, 'Test3'); +INSERT INTO PKTABLE VALUES (4, 'Test4'); +INSERT INTO PKTABLE VALUES (5, 'Test5'); +-- Insert successful rows into FK TABLE +INSERT INTO FKTABLE VALUES (1, 2); +INSERT INTO FKTABLE VALUES (2, 3); +INSERT INTO FKTABLE VALUES (3, 4); +INSERT INTO FKTABLE VALUES (NULL, 1); +-- Insert a failed row into FK TABLE +INSERT INTO FKTABLE VALUES (100, 2); +ERROR: insert or update on table "fktable" violates foreign key constraint "fktable_ftest1_fkey" +DETAIL: Key (ftest1)=(100) is not present in table "pktable". +-- Check FKTABLE +SELECT * FROM FKTABLE ORDER BY 1, 2; + ftest1 | ftest2 +--------+-------- + 1 | 2 + 2 | 3 + 3 | 4 + | 1 +(4 rows) + +-- Delete a row from PK TABLE +DELETE FROM PKTABLE WHERE ptest1=1; +-- Check FKTABLE for removal of matched row +SELECT * FROM FKTABLE ORDER BY 1, 2; + ftest1 | ftest2 +--------+-------- + 2 | 3 + 3 | 4 + | 1 +(3 rows) + +-- Update a row from PK TABLE +UPDATE PKTABLE SET ptest1=1 WHERE ptest1=2; +ERROR: Partition column can't be updated in current version +-- Check FKTABLE for update of matched row +SELECT * FROM FKTABLE ORDER BY 1, 2; + ftest1 | ftest2 +--------+-------- + 2 | 3 + 3 | 4 + | 1 +(3 rows) + +DROP TABLE FKTABLE; +DROP TABLE PKTABLE; +-- +-- check set NULL and table constraint on multiple columns +-- +CREATE TABLE PKTABLE ( ptest1 int, ptest2 int, ptest3 text, PRIMARY KEY(ptest1, ptest2) ); +NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "pktable_pkey" for table "pktable" +CREATE TABLE FKTABLE ( ftest1 int, ftest2 int, ftest3 int, CONSTRAINT constrname FOREIGN KEY(ftest1, ftest2) + REFERENCES PKTABLE MATCH FULL ON DELETE SET NULL ON UPDATE SET NULL); +-- Test comments +COMMENT ON CONSTRAINT constrname_wrong ON FKTABLE IS 'fk constraint comment'; +ERROR: constraint "constrname_wrong" for table "fktable" does not exist +COMMENT ON CONSTRAINT constrname ON FKTABLE IS 'fk constraint comment'; +COMMENT ON CONSTRAINT constrname ON FKTABLE IS NULL; +-- Insert test data into PKTABLE +INSERT INTO PKTABLE VALUES (1, 2, 'Test1'); +INSERT INTO PKTABLE VALUES (1, 3, 'Test1-2'); +INSERT INTO PKTABLE VALUES (2, 4, 'Test2'); +INSERT INTO PKTABLE VALUES (3, 6, 'Test3'); +INSERT INTO PKTABLE VALUES (4, 8, 'Test4'); +INSERT INTO PKTABLE VALUES (5, 10, 'Test5'); +-- Insert successful rows into FK TABLE +INSERT INTO FKTABLE VALUES (1, 2, 4); +INSERT INTO FKTABLE VALUES (1, 3, 5); +INSERT INTO FKTABLE VALUES (2, 4, 8); +INSERT INTO FKTABLE VALUES (3, 6, 12); +INSERT INTO FKTABLE VALUES (NULL, NULL, 0); +-- Insert failed rows into FK TABLE +INSERT INTO FKTABLE VALUES (100, 2, 4); +ERROR: insert or update on table "fktable" violates foreign key constraint "constrname" +DETAIL: Key (ftest1, ftest2)=(100, 2) is not present in table "pktable". +INSERT INTO FKTABLE VALUES (2, 2, 4); +ERROR: insert or update on table "fktable" violates foreign key constraint "constrname" +DETAIL: Key (ftest1, ftest2)=(2, 2) is not present in table "pktable". +INSERT INTO FKTABLE VALUES (NULL, 2, 4); +ERROR: insert or update on table "fktable" violates foreign key constraint "constrname" +DETAIL: MATCH FULL does not allow mixing of null and nonnull key values. +INSERT INTO FKTABLE VALUES (1, NULL, 4); +ERROR: insert or update on table "fktable" violates foreign key constraint "constrname" +DETAIL: MATCH FULL does not allow mixing of null and nonnull key values. +-- Check FKTABLE +SELECT * FROM FKTABLE ORDER BY 1, 2, 3; + ftest1 | ftest2 | ftest3 +--------+--------+-------- + 1 | 2 | 4 + 1 | 3 | 5 + 2 | 4 | 8 + 3 | 6 | 12 + | | 0 +(5 rows) + +-- Delete a row from PK TABLE +DELETE FROM PKTABLE WHERE ptest1=1 and ptest2=2; +-- Check FKTABLE for removal of matched row +SELECT * FROM FKTABLE ORDER BY 1, 2, 3; + ftest1 | ftest2 | ftest3 +--------+--------+-------- + 1 | 3 | 5 + 2 | 4 | 8 + 3 | 6 | 12 + | | 0 + | | 4 +(5 rows) + +-- Delete another row from PK TABLE +DELETE FROM PKTABLE WHERE ptest1=5 and ptest2=10; +-- Check FKTABLE (should be no change) +SELECT * FROM FKTABLE ORDER BY 1, 2, 3; + ftest1 | ftest2 | ftest3 +--------+--------+-------- + 1 | 3 | 5 + 2 | 4 | 8 + 3 | 6 | 12 + | | 0 + | | 4 +(5 rows) + +-- Update a row from PK TABLE +UPDATE PKTABLE SET ptest1=1 WHERE ptest1=2; +ERROR: Partition column can't be updated in current version +-- Check FKTABLE for update of matched row +SELECT * FROM FKTABLE ORDER BY 1, 2, 3; + ftest1 | ftest2 | ftest3 +--------+--------+-------- + 1 | 3 | 5 + 2 | 4 | 8 + 3 | 6 | 12 + | | 0 + | | 4 +(5 rows) + +-- Try altering the column type where foreign keys are involved +ALTER TABLE PKTABLE ALTER COLUMN ptest1 TYPE bigint; +ALTER TABLE FKTABLE ALTER COLUMN ftest1 TYPE bigint; +SELECT * FROM PKTABLE ORDER BY 1, 2, 3; + ptest1 | ptest2 | ptest3 +--------+--------+--------- + 1 | 3 | Test1-2 + 2 | 4 | Test2 + 3 | 6 | Test3 + 4 | 8 | Test4 +(4 rows) + +SELECT * FROM FKTABLE ORDER BY 1, 2, 3; + ftest1 | ftest2 | ftest3 +--------+--------+-------- + 1 | 3 | 5 + 2 | 4 | 8 + 3 | 6 | 12 + | | 0 + | | 4 +(5 rows) + +DROP TABLE PKTABLE CASCADE; +NOTICE: drop cascades to constraint constrname on table fktable +DROP TABLE FKTABLE; +-- +-- check set default and table constraint on multiple columns +-- +CREATE TABLE PKTABLE ( ptest1 int, ptest2 int, ptest3 text, PRIMARY KEY(ptest1, ptest2) ); +NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "pktable_pkey" for table "pktable" +CREATE TABLE FKTABLE ( ftest1 int DEFAULT -1, ftest2 int DEFAULT -2, ftest3 int, CONSTRAINT constrname2 FOREIGN KEY(ftest1, ftest2) + REFERENCES PKTABLE MATCH FULL ON DELETE SET DEFAULT ON UPDATE SET DEFAULT); +-- Insert a value in PKTABLE for default +INSERT INTO PKTABLE VALUES (-1, -2, 'The Default!'); +-- Insert test data into PKTABLE +INSERT INTO PKTABLE VALUES (1, 2, 'Test1'); +INSERT INTO PKTABLE VALUES (1, 3, 'Test1-2'); +INSERT INTO PKTABLE VALUES (2, 4, 'Test2'); +INSERT INTO PKTABLE VALUES (3, 6, 'Test3'); +INSERT INTO PKTABLE VALUES (4, 8, 'Test4'); +INSERT INTO PKTABLE VALUES (5, 10, 'Test5'); +-- Insert successful rows into FK TABLE +INSERT INTO FKTABLE VALUES (1, 2, 4); +INSERT INTO FKTABLE VALUES (1, 3, 5); +INSERT INTO FKTABLE VALUES (2, 4, 8); +INSERT INTO FKTABLE VALUES (3, 6, 12); +INSERT INTO FKTABLE VALUES (NULL, NULL, 0); +-- Insert failed rows into FK TABLE +INSERT INTO FKTABLE VALUES (100, 2, 4); +ERROR: insert or update on table "fktable" violates foreign key constraint "constrname2" +DETAIL: Key (ftest1, ftest2)=(100, 2) is not present in table "pktable". +INSERT INTO FKTABLE VALUES (2, 2, 4); +ERROR: insert or update on table "fktable" violates foreign key constraint "constrname2" +DETAIL: Key (ftest1, ftest2)=(2, 2) is not present in table "pktable". +INSERT INTO FKTABLE VALUES (NULL, 2, 4); +ERROR: insert or update on table "fktable" violates foreign key constraint "constrname2" +DETAIL: MATCH FULL does not allow mixing of null and nonnull key values. +INSERT INTO FKTABLE VALUES (1, NULL, 4); +ERROR: insert or update on table "fktable" violates foreign key constraint "constrname2" +DETAIL: MATCH FULL does not allow mixing of null and nonnull key values. +-- Check FKTABLE +SELECT * FROM FKTABLE ORDER BY 1, 2, 3; + ftest1 | ftest2 | ftest3 +--------+--------+-------- + 1 | 2 | 4 + 1 | 3 | 5 + 2 | 4 | 8 + 3 | 6 | 12 + | | 0 +(5 rows) + +-- Delete a row from PK TABLE +DELETE FROM PKTABLE WHERE ptest1=1 and ptest2=2; +-- Check FKTABLE to check for removal +SELECT * FROM FKTABLE ORDER BY 1, 2, 3; + ftest1 | ftest2 | ftest3 +--------+--------+-------- + -1 | -2 | 4 + 1 | 3 | 5 + 2 | 4 | 8 + 3 | 6 | 12 + | | 0 +(5 rows) + +-- Delete another row from PK TABLE +DELETE FROM PKTABLE WHERE ptest1=5 and ptest2=10; +-- Check FKTABLE (should be no change) +SELECT * FROM FKTABLE ORDER BY 1, 2, 3; + ftest1 | ftest2 | ftest3 +--------+--------+-------- + -1 | -2 | 4 + 1 | 3 | 5 + 2 | 4 | 8 + 3 | 6 | 12 + | | 0 +(5 rows) + +-- Update a row from PK TABLE +UPDATE PKTABLE SET ptest1=1 WHERE ptest1=2; +ERROR: Partition column can't be updated in current version +-- Check FKTABLE for update of matched row +SELECT * FROM FKTABLE ORDER BY 1, 2, 3; + ftest1 | ftest2 | ftest3 +--------+--------+-------- + -1 | -2 | 4 + 1 | 3 | 5 + 2 | 4 | 8 + 3 | 6 | 12 + | | 0 +(5 rows) + +-- this should fail for lack of CASCADE +DROP TABLE PKTABLE; +ERROR: cannot drop table pktable because other objects depend on it +DETAIL: constraint constrname2 on table fktable depends on table pktable +HINT: Use DROP ... CASCADE to drop the dependent objects too. +DROP TABLE PKTABLE CASCADE; +NOTICE: drop cascades to constraint constrname2 on table fktable +DROP TABLE FKTABLE; +-- +-- First test, check with no on delete or on update +-- +CREATE TABLE PKTABLE ( ptest1 int PRIMARY KEY, ptest2 text ); +NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "pktable_pkey" for table "pktable" +CREATE TABLE FKTABLE ( ftest1 int REFERENCES PKTABLE MATCH FULL, ftest2 int ); +-- Insert test data into PKTABLE +INSERT INTO PKTABLE VALUES (1, 'Test1'); +INSERT INTO PKTABLE VALUES (2, 'Test2'); +INSERT INTO PKTABLE VALUES (3, 'Test3'); +INSERT INTO PKTABLE VALUES (4, 'Test4'); +INSERT INTO PKTABLE VALUES (5, 'Test5'); +-- Insert successful rows into FK TABLE +INSERT INTO FKTABLE VALUES (1, 2); +INSERT INTO FKTABLE VALUES (2, 3); +INSERT INTO FKTABLE VALUES (3, 4); +INSERT INTO FKTABLE VALUES (NULL, 1); +-- Insert a failed row into FK TABLE +INSERT INTO FKTABLE VALUES (100, 2); +ERROR: insert or update on table "fktable" violates foreign key constraint "fktable_ftest1_fkey" +DETAIL: Key (ftest1)=(100) is not present in table "pktable". +-- Check FKTABLE +SELECT * FROM FKTABLE ORDER BY 1, 2; + ftest1 | ftest2 +--------+-------- + 1 | 2 + 2 | 3 + 3 | 4 + | 1 +(4 rows) + +-- Check PKTABLE +SELECT * FROM PKTABLE ORDER BY 1, 2; + ptest1 | ptest2 +--------+-------- + 1 | Test1 + 2 | Test2 + 3 | Test3 + 4 | Test4 + 5 | Test5 +(5 rows) + +-- Delete a row from PK TABLE (should fail) +DELETE FROM PKTABLE WHERE ptest1=1; +ERROR: update or delete on table "pktable" violates foreign key constraint "fktable_ftest1_fkey" on table "fktable" +DETAIL: Key (ptest1)=(1) is still referenced from table "fktable". +-- Delete a row from PK TABLE (should succeed) +DELETE FROM PKTABLE WHERE ptest1=5; +-- Check PKTABLE for deletes +SELECT * FROM PKTABLE ORDER BY 1, 2; + ptest1 | ptest2 +--------+-------- + 1 | Test1 + 2 | Test2 + 3 | Test3 + 4 | Test4 +(4 rows) + +-- Update a row from PK TABLE (should fail) +UPDATE PKTABLE SET ptest1=0 WHERE ptest1=2; +ERROR: Partition column can't be updated in current version +-- Update a row from PK TABLE (should succeed) +UPDATE PKTABLE SET ptest1=0 WHERE ptest1=4; +ERROR: Partition column can't be updated in current version +-- Check PKTABLE for updates +SELECT * FROM PKTABLE ORDER BY 1, 2; + ptest1 | ptest2 +--------+-------- + 1 | Test1 + 2 | Test2 + 3 | Test3 + 4 | Test4 +(4 rows) + +DROP TABLE FKTABLE; +DROP TABLE PKTABLE; +-- MATCH unspecified +-- Base test restricting update/delete +CREATE TABLE PKTABLE ( ptest1 int, ptest2 int, ptest3 int, ptest4 text, PRIMARY KEY(ptest1, ptest2, ptest3) ); +NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "pktable_pkey" for table "pktable" +CREATE TABLE FKTABLE ( ftest1 int, ftest2 int, ftest3 int, ftest4 int, CONSTRAINT constrname3 + FOREIGN KEY(ftest1, ftest2, ftest3) REFERENCES PKTABLE); +-- Insert Primary Key values +INSERT INTO PKTABLE VALUES (1, 2, 3, 'test1'); +INSERT INTO PKTABLE VALUES (1, 3, 3, 'test2'); +INSERT INTO PKTABLE VALUES (2, 3, 4, 'test3'); +INSERT INTO PKTABLE VALUES (2, 4, 5, 'test4'); +-- Insert Foreign Key values +INSERT INTO FKTABLE VALUES (1, 2, 3, 1); +INSERT INTO FKTABLE VALUES (NULL, 2, 3, 2); +INSERT INTO FKTABLE VALUES (2, NULL, 3, 3); +INSERT INTO FKTABLE VALUES (NULL, 2, 7, 4); +INSERT INTO FKTABLE VALUES (NULL, 3, 4, 5); +-- Insert a failed values +INSERT INTO FKTABLE VALUES (1, 2, 7, 6); +ERROR: insert or update on table "fktable" violates foreign key constraint "constrname3" +DETAIL: Key (ftest1, ftest2, ftest3)=(1, 2, 7) is not present in table "pktable". +-- Show FKTABLE +SELECT * from FKTABLE ORDER BY 1, 2, 3,4; + ftest1 | ftest2 | ftest3 | ftest4 +--------+--------+--------+-------- + 1 | 2 | 3 | 1 + 2 | | 3 | 3 + | 2 | 3 | 2 + | 2 | 7 | 4 + | 3 | 4 | 5 +(5 rows) + +-- Try to update something that should fail +UPDATE PKTABLE set ptest2=5 where ptest2=2; +ERROR: update or delete on table "pktable" violates foreign key constraint "constrname3" on table "fktable" +DETAIL: Key (ptest1, ptest2, ptest3)=(1, 2, 3) is still referenced from table "fktable". +-- Try to update something that should succeed +UPDATE PKTABLE set ptest1=1 WHERE ptest2=3; +ERROR: Partition column can't be updated in current version +-- Try to delete something that should fail +DELETE FROM PKTABLE where ptest1=1 and ptest2=2 and ptest3=3; +ERROR: update or delete on table "pktable" violates foreign key constraint "constrname3" on table "fktable" +DETAIL: Key (ptest1, ptest2, ptest3)=(1, 2, 3) is still referenced from table "fktable". +-- Try to delete something that should work +DELETE FROM PKTABLE where ptest1=2; +-- Show PKTABLE and FKTABLE +SELECT * from PKTABLE ORDER BY 1, 2, 3,4; + ptest1 | ptest2 | ptest3 | ptest4 +--------+--------+--------+-------- + 1 | 2 | 3 | test1 + 1 | 3 | 3 | test2 +(2 rows) + +SELECT * from FKTABLE ORDER BY 1, 2, 3,4; + ftest1 | ftest2 | ftest3 | ftest4 +--------+--------+--------+-------- + 1 | 2 | 3 | 1 + 2 | | 3 | 3 + | 2 | 3 | 2 + | 2 | 7 | 4 + | 3 | 4 | 5 +(5 rows) + +DROP TABLE FKTABLE; +DROP TABLE PKTABLE; +-- cascade update/delete +CREATE TABLE PKTABLE ( ptest1 int, ptest2 int, ptest3 int, ptest4 text, PRIMARY KEY(ptest1, ptest2, ptest3) ); +NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "pktable_pkey" for table "pktable" +CREATE TABLE FKTABLE ( ftest1 int, ftest2 int, ftest3 int, ftest4 int, CONSTRAINT constrname3 + FOREIGN KEY(ftest1, ftest2, ftest3) REFERENCES PKTABLE + ON DELETE CASCADE ON UPDATE CASCADE); +-- Insert Primary Key values +INSERT INTO PKTABLE VALUES (1, 2, 3, 'test1'); +INSERT INTO PKTABLE VALUES (1, 3, 3, 'test2'); +INSERT INTO PKTABLE VALUES (2, 3, 4, 'test3'); +INSERT INTO PKTABLE VALUES (2, 4, 5, 'test4'); +-- Insert Foreign Key values +INSERT INTO FKTABLE VALUES (1, 2, 3, 1); +INSERT INTO FKTABLE VALUES (NULL, 2, 3, 2); +INSERT INTO FKTABLE VALUES (2, NULL, 3, 3); +INSERT INTO FKTABLE VALUES (NULL, 2, 7, 4); +INSERT INTO FKTABLE VALUES (NULL, 3, 4, 5); +-- Insert a failed values +INSERT INTO FKTABLE VALUES (1, 2, 7, 6); +ERROR: insert or update on table "fktable" violates foreign key constraint "constrname3" +DETAIL: Key (ftest1, ftest2, ftest3)=(1, 2, 7) is not present in table "pktable". +-- Show FKTABLE +SELECT * from FKTABLE ORDER BY 1, 2, 3,4; + ftest1 | ftest2 | ftest3 | ftest4 +--------+--------+--------+-------- + 1 | 2 | 3 | 1 + 2 | | 3 | 3 + | 2 | 3 | 2 + | 2 | 7 | 4 + | 3 | 4 | 5 +(5 rows) + +-- Try to update something that will cascade +UPDATE PKTABLE set ptest2=5 where ptest2=2; +-- Try to update something that should not cascade +UPDATE PKTABLE set ptest1=1 WHERE ptest2=3; +ERROR: Partition column can't be updated in current version +-- Show PKTABLE and FKTABLE +SELECT * from PKTABLE ORDER BY 1, 2, 3,4; + ptest1 | ptest2 | ptest3 | ptest4 +--------+--------+--------+-------- + 1 | 3 | 3 | test2 + 1 | 5 | 3 | test1 + 2 | 3 | 4 | test3 + 2 | 4 | 5 | test4 +(4 rows) + +SELECT * from FKTABLE ORDER BY 1, 2, 3,4; + ftest1 | ftest2 | ftest3 | ftest4 +--------+--------+--------+-------- + 1 | 5 | 3 | 1 + 2 | | 3 | 3 + | 2 | 3 | 2 + | 2 | 7 | 4 + | 3 | 4 | 5 +(5 rows) + +-- Try to delete something that should cascade +DELETE FROM PKTABLE where ptest1=1 and ptest2=5 and ptest3=3; +-- Show PKTABLE and FKTABLE +SELECT * from PKTABLE ORDER BY 1, 2, 3,4; + ptest1 | ptest2 | ptest3 | ptest4 +--------+--------+--------+-------- + 1 | 3 | 3 | test2 + 2 | 3 | 4 | test3 + 2 | 4 | 5 | test4 +(3 rows) + +SELECT * from FKTABLE ORDER BY 1, 2, 3,4; + ftest1 | ftest2 | ftest3 | ftest4 +--------+--------+--------+-------- + 2 | | 3 | 3 + | 2 | 3 | 2 + | 2 | 7 | 4 + | 3 | 4 | 5 +(4 rows) + +-- Try to delete something that should not have a cascade +DELETE FROM PKTABLE where ptest1=2; +-- Show PKTABLE and FKTABLE +SELECT * from PKTABLE ORDER BY 1, 2, 3,4; + ptest1 | ptest2 | ptest3 | ptest4 +--------+--------+--------+-------- + 1 | 3 | 3 | test2 +(1 row) + +SELECT * from FKTABLE ORDER BY 1, 2, 3,4; + ftest1 | ftest2 | ftest3 | ftest4 +--------+--------+--------+-------- + 2 | | 3 | 3 + | 2 | 3 | 2 + | 2 | 7 | 4 + | 3 | 4 | 5 +(4 rows) + +DROP TABLE FKTABLE; +DROP TABLE PKTABLE; +-- set null update / set default delete +CREATE TABLE PKTABLE ( ptest1 int, ptest2 int, ptest3 int, ptest4 text, PRIMARY KEY(ptest1, ptest2, ptest3) ); +NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "pktable_pkey" for table "pktable" +CREATE TABLE FKTABLE ( ftest1 int DEFAULT 0, ftest2 int, ftest3 int, ftest4 int, CONSTRAINT constrname3 + FOREIGN KEY(ftest1, ftest2, ftest3) REFERENCES PKTABLE + ON DELETE SET DEFAULT ON UPDATE SET NULL); +-- Insert Primary Key values +INSERT INTO PKTABLE VALUES (1, 2, 3, 'test1'); +INSERT INTO PKTABLE VALUES (1, 3, 3, 'test2'); +INSERT INTO PKTABLE VALUES (2, 3, 4, 'test3'); +INSERT INTO PKTABLE VALUES (2, 4, 5, 'test4'); +-- Insert Foreign Key values +INSERT INTO FKTABLE VALUES (1, 2, 3, 1); +INSERT INTO FKTABLE VALUES (2, 3, 4, 1); +INSERT INTO FKTABLE VALUES (NULL, 2, 3, 2); +INSERT INTO FKTABLE VALUES (2, NULL, 3, 3); +INSERT INTO FKTABLE VALUES (NULL, 2, 7, 4); +INSERT INTO FKTABLE VALUES (NULL, 3, 4, 5); +-- Insert a failed values +INSERT INTO FKTABLE VALUES (1, 2, 7, 6); +ERROR: insert or update on table "fktable" violates foreign key constraint "constrname3" +DETAIL: Key (ftest1, ftest2, ftest3)=(1, 2, 7) is not present in table "pktable". +-- Show FKTABLE +SELECT * from FKTABLE ORDER BY 1, 2, 3,4; + ftest1 | ftest2 | ftest3 | ftest4 +--------+--------+--------+-------- + 1 | 2 | 3 | 1 + 2 | 3 | 4 | 1 + 2 | | 3 | 3 + | 2 | 3 | 2 + | 2 | 7 | 4 + | 3 | 4 | 5 +(6 rows) + +-- Try to update something that will set null +UPDATE PKTABLE set ptest2=5 where ptest2=2; +-- Try to update something that should not set null +UPDATE PKTABLE set ptest2=2 WHERE ptest2=3 and ptest1=1; +-- Show PKTABLE and FKTABLE +SELECT * from PKTABLE ORDER BY 1, 2, 3,4; + ptest1 | ptest2 | ptest3 | ptest4 +--------+--------+--------+-------- + 1 | 2 | 3 | test2 + 1 | 5 | 3 | test1 + 2 | 3 | 4 | test3 + 2 | 4 | 5 | test4 +(4 rows) + +SELECT * from FKTABLE ORDER BY 1, 2, 3,4; + ftest1 | ftest2 | ftest3 | ftest4 +--------+--------+--------+-------- + 1 | | 3 | 1 + 2 | 3 | 4 | 1 + 2 | | 3 | 3 + | 2 | 3 | 2 + | 2 | 7 | 4 + | 3 | 4 | 5 +(6 rows) + +-- Try to delete something that should set default +DELETE FROM PKTABLE where ptest1=2 and ptest2=3 and ptest3=4; +-- Show PKTABLE and FKTABLE +SELECT * from PKTABLE ORDER BY 1, 2, 3,4; + ptest1 | ptest2 | ptest3 | ptest4 +--------+--------+--------+-------- + 1 | 2 | 3 | test2 + 1 | 5 | 3 | test1 + 2 | 4 | 5 | test4 +(3 rows) + +SELECT * from FKTABLE ORDER BY 1, 2, 3,4; + ftest1 | ftest2 | ftest3 | ftest4 +--------+--------+--------+-------- + 0 | | | 1 + 1 | | 3 | 1 + 2 | | 3 | 3 + | 2 | 3 | 2 + | 2 | 7 | 4 + | 3 | 4 | 5 +(6 rows) + +-- Try to delete something that should not set default +DELETE FROM PKTABLE where ptest2=5; +-- Show PKTABLE and FKTABLE +SELECT * from PKTABLE ORDER BY 1, 2, 3,4; + ptest1 | ptest2 | ptest3 | ptest4 +--------+--------+--------+-------- + 1 | 2 | 3 | test2 + 2 | 4 | 5 | test4 +(2 rows) + +SELECT * from FKTABLE ORDER BY 1, 2, 3,4; + ftest1 | ftest2 | ftest3 | ftest4 +--------+--------+--------+-------- + 0 | | | 1 + 1 | | 3 | 1 + 2 | | 3 | 3 + | 2 | 3 | 2 + | 2 | 7 | 4 + | 3 | 4 | 5 +(6 rows) + +DROP TABLE FKTABLE; +DROP TABLE PKTABLE; +-- set default update / set null delete +CREATE TABLE PKTABLE ( ptest1 int, ptest2 int, ptest3 int, ptest4 text, PRIMARY KEY(ptest1, ptest2, ptest3) ); +NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "pktable_pkey" for table "pktable" +CREATE TABLE FKTABLE ( ftest1 int DEFAULT 0, ftest2 int DEFAULT -1, ftest3 int, ftest4 int, CONSTRAINT constrname3 + FOREIGN KEY(ftest1, ftest2, ftest3) REFERENCES PKTABLE + ON DELETE SET NULL ON UPDATE SET DEFAULT); +-- Insert Primary Key values +INSERT INTO PKTABLE VALUES (1, 2, 3, 'test1'); +INSERT INTO PKTABLE VALUES (1, 3, 3, 'test2'); +INSERT INTO PKTABLE VALUES (2, 3, 4, 'test3'); +INSERT INTO PKTABLE VALUES (2, 4, 5, 'test4'); +INSERT INTO PKTABLE VALUES (2, -1, 5, 'test5'); +-- Insert Foreign Key values +INSERT INTO FKTABLE VALUES (1, 2, 3, 1); +INSERT INTO FKTABLE VALUES (2, 3, 4, 1); +INSERT INTO FKTABLE VALUES (2, 4, 5, 1); +INSERT INTO FKTABLE VALUES (NULL, 2, 3, 2); +INSERT INTO FKTABLE VALUES (2, NULL, 3, 3); +INSERT INTO FKTABLE VALUES (NULL, 2, 7, 4); +INSERT INTO FKTABLE VALUES (NULL, 3, 4, 5); +-- Insert a failed values +INSERT INTO FKTABLE VALUES (1, 2, 7, 6); +ERROR: insert or update on table "fktable" violates foreign key constraint "constrname3" +DETAIL: Key (ftest1, ftest2, ftest3)=(1, 2, 7) is not present in table "pktable". +-- Show FKTABLE +SELECT * from FKTABLE ORDER BY 1, 2, 3,4; + ftest1 | ftest2 | ftest3 | ftest4 +--------+--------+--------+-------- + 1 | 2 | 3 | 1 + 2 | 3 | 4 | 1 + 2 | 4 | 5 | 1 + 2 | | 3 | 3 + | 2 | 3 | 2 + | 2 | 7 | 4 + | 3 | 4 | 5 +(7 rows) + +-- Try to update something that will fail +UPDATE PKTABLE set ptest2=5 where ptest2=2; +ERROR: insert or update on table "fktable" violates foreign key constraint "constrname3" +DETAIL: Key (ftest1, ftest2, ftest3)=(1, -1, 3) is not present in table "pktable". +-- Try to update something that will set default +UPDATE PKTABLE set ptest1=0, ptest2=5, ptest3=10 where ptest2=2; +ERROR: Partition column can't be updated in current version +UPDATE PKTABLE set ptest2=10 where ptest2=4; +-- Try to update something that should not set default +UPDATE PKTABLE set ptest2=2 WHERE ptest2=3 and ptest1=1; +ERROR: duplicate key value violates unique constraint "pktable_pkey" +DETAIL: Key (ptest1, ptest2, ptest3)=(1, 2, 3) already exists. +-- Show PKTABLE and FKTABLE +SELECT * from PKTABLE ORDER BY 1, 2, 3,4; + ptest1 | ptest2 | ptest3 | ptest4 +--------+--------+--------+-------- + 1 | 2 | 3 | test1 + 1 | 3 | 3 | test2 + 2 | -1 | 5 | test5 + 2 | 3 | 4 | test3 + 2 | 10 | 5 | test4 +(5 rows) + +SELECT * from FKTABLE ORDER BY 1, 2, 3,4; + ftest1 | ftest2 | ftest3 | ftest4 +--------+--------+--------+-------- + 1 | 2 | 3 | 1 + 2 | -1 | 5 | 1 + 2 | 3 | 4 | 1 + 2 | | 3 | 3 + | 2 | 3 | 2 + | 2 | 7 | 4 + | 3 | 4 | 5 +(7 rows) + +-- Try to delete something that should set null +DELETE FROM PKTABLE where ptest1=2 and ptest2=3 and ptest3=4; +-- Show PKTABLE and FKTABLE +SELECT * from PKTABLE ORDER BY 1, 2, 3,4; + ptest1 | ptest2 | ptest3 | ptest4 +--------+--------+--------+-------- + 1 | 2 | 3 | test1 + 1 | 3 | 3 | test2 + 2 | -1 | 5 | test5 + 2 | 10 | 5 | test4 +(4 rows) + +SELECT * from FKTABLE ORDER BY 1, 2, 3,4; + ftest1 | ftest2 | ftest3 | ftest4 +--------+--------+--------+-------- + 1 | 2 | 3 | 1 + 2 | -1 | 5 | 1 + 2 | | 3 | 3 + | 2 | 3 | 2 + | 2 | 7 | 4 + | 3 | 4 | 5 + | | | 1 +(7 rows) + +-- Try to delete something that should not set null +DELETE FROM PKTABLE where ptest2=5; +-- Show PKTABLE and FKTABLE +SELECT * from PKTABLE ORDER BY 1, 2, 3,4; + ptest1 | ptest2 | ptest3 | ptest4 +--------+--------+--------+-------- + 1 | 2 | 3 | test1 + 1 | 3 | 3 | test2 + 2 | -1 | 5 | test5 + 2 | 10 | 5 | test4 +(4 rows) + +SELECT * from FKTABLE ORDER BY 1, 2, 3,4; + ftest1 | ftest2 | ftest3 | ftest4 +--------+--------+--------+-------- + 1 | 2 | 3 | 1 + 2 | -1 | 5 | 1 + 2 | | 3 | 3 + | 2 | 3 | 2 + | 2 | 7 | 4 + | 3 | 4 | 5 + | | | 1 +(7 rows) + +DROP TABLE FKTABLE; +DROP TABLE PKTABLE; +CREATE TABLE PKTABLE (ptest1 int PRIMARY KEY); +NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "pktable_pkey" for table "pktable" +CREATE TABLE FKTABLE_FAIL1 ( ftest1 int, CONSTRAINT fkfail1 FOREIGN KEY (ftest2) REFERENCES PKTABLE); +ERROR: column "ftest2" referenced in foreign key constraint does not exist +CREATE TABLE FKTABLE_FAIL2 ( ftest1 int, CONSTRAINT fkfail1 FOREIGN KEY (ftest1) REFERENCES PKTABLE(ptest2)); +ERROR: column "ptest2" referenced in foreign key constraint does not exist +DROP TABLE FKTABLE_FAIL1; +ERROR: table "fktable_fail1" does not exist +DROP TABLE FKTABLE_FAIL2; +ERROR: table "fktable_fail2" does not exist +DROP TABLE PKTABLE; +-- Test for referencing column number smaller than referenced constraint +CREATE TABLE PKTABLE (ptest1 int, ptest2 int, UNIQUE(ptest1, ptest2)); +NOTICE: CREATE TABLE / UNIQUE will create implicit index "pktable_ptest1_ptest2_key" for table "pktable" +CREATE TABLE FKTABLE_FAIL1 (ftest1 int REFERENCES pktable(ptest1)); +ERROR: there is no unique constraint matching given keys for referenced table "pktable" +DROP TABLE FKTABLE_FAIL1; +ERROR: table "fktable_fail1" does not exist +DROP TABLE PKTABLE; +-- +-- Tests for mismatched types +-- +-- Basic one column, two table setup +CREATE TABLE PKTABLE (ptest1 int PRIMARY KEY); +NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "pktable_pkey" for table "pktable" +INSERT INTO PKTABLE VALUES(42); +-- This next should fail, because int=inet does not exist +CREATE TABLE FKTABLE (ftest1 inet REFERENCES pktable); +ERROR: foreign key constraint "fktable_ftest1_fkey" cannot be implemented +DETAIL: Key columns "ftest1" and "ptest1" are of incompatible types: inet and integer. +-- This should also fail for the same reason, but here we +-- give the column name +CREATE TABLE FKTABLE (ftest1 inet REFERENCES pktable(ptest1)); +ERROR: Column ftest1 is not a hash distributable data type +-- This should succeed, even though they are different types, +-- because int=int8 exists and is a member of the integer opfamily +CREATE TABLE FKTABLE (ftest1 int8 REFERENCES pktable); +-- Check it actually works +INSERT INTO FKTABLE VALUES(42); -- should succeed +INSERT INTO FKTABLE VALUES(43); -- should fail +ERROR: insert or update on table "fktable" violates foreign key constraint "fktable_ftest1_fkey" +DETAIL: Key (ftest1)=(43) is not present in table "pktable". +UPDATE FKTABLE SET ftest1 = ftest1; -- should succeed +UPDATE FKTABLE SET ftest1 = ftest1 + 1; -- should fail +ERROR: insert or update on table "fktable" violates foreign key constraint "fktable_ftest1_fkey" +DETAIL: Key (ftest1)=(43) is not present in table "pktable". +DROP TABLE FKTABLE; +-- This should fail, because we'd have to cast numeric to int which is +-- not an implicit coercion (or use numeric=numeric, but that's not part +-- of the integer opfamily) +CREATE TABLE FKTABLE (ftest1 numeric REFERENCES pktable); +ERROR: foreign key constraint "fktable_ftest1_fkey" cannot be implemented +DETAIL: Key columns "ftest1" and "ptest1" are of incompatible types: numeric and integer. +DROP TABLE PKTABLE; +-- On the other hand, this should work because int implicitly promotes to +-- numeric, and we allow promotion on the FK side +CREATE TABLE PKTABLE (ptest1 numeric PRIMARY KEY); +ERROR: Column ptest1 is not a hash distributable data type +INSERT INTO PKTABLE VALUES(42); +ERROR: relation "pktable" does not exist +LINE 1: INSERT INTO PKTABLE VALUES(42); + ^ +CREATE TABLE FKTABLE (ftest1 int REFERENCES pktable); +ERROR: relation "pktable" does not exist +-- Check it actually works +INSERT INTO FKTABLE VALUES(42); -- should succeed +ERROR: relation "fktable" does not exist +LINE 1: INSERT INTO FKTABLE VALUES(42); + ^ +INSERT INTO FKTABLE VALUES(43); -- should fail +ERROR: relation "fktable" does not exist +LINE 1: INSERT INTO FKTABLE VALUES(43); + ^ +UPDATE FKTABLE SET ftest1 = ftest1; -- should succeed +ERROR: relation "fktable" does not exist +LINE 1: UPDATE FKTABLE SET ftest1 = ftest1; + ^ +UPDATE FKTABLE SET ftest1 = ftest1 + 1; -- should fail +ERROR: relation "fktable" does not exist +LINE 1: UPDATE FKTABLE SET ftest1 = ftest1 + 1; + ^ +DROP TABLE FKTABLE; +ERROR: table "fktable" does not exist +DROP TABLE PKTABLE; +ERROR: table "pktable" does not exist +-- Two columns, two tables +CREATE TABLE PKTABLE (ptest1 int, ptest2 inet, PRIMARY KEY(ptest1, ptest2)); +NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "pktable_pkey" for table "pktable" +-- This should fail, because we just chose really odd types +CREATE TABLE FKTABLE (ftest1 cidr, ftest2 timestamp, FOREIGN KEY(ftest1, ftest2) REFERENCES pktable); +ERROR: foreign key constraint "fktable_ftest1_fkey" cannot be implemented +DETAIL: Key columns "ftest1" and "ptest1" are of incompatible types: cidr and integer. +-- Again, so should this... +CREATE TABLE FKTABLE (ftest1 cidr, ftest2 timestamp, FOREIGN KEY(ftest1, ftest2) REFERENCES pktable(ptest1, ptest2)); +ERROR: Column ftest1 is not a hash distributable data type +-- This fails because we mixed up the column ordering +CREATE TABLE FKTABLE (ftest1 int, ftest2 inet, FOREIGN KEY(ftest2, ftest1) REFERENCES pktable); +ERROR: foreign key constraint "fktable_ftest2_fkey" cannot be implemented +DETAIL: Key columns "ftest2" and "ptest1" are of incompatible types: inet and integer. +-- As does this... +CREATE TABLE FKTABLE (ftest1 int, ftest2 inet, FOREIGN KEY(ftest2, ftest1) REFERENCES pktable(ptest1, ptest2)); +ERROR: Column ftest2 is not a hash distributable data type +-- And again.. +CREATE TABLE FKTABLE (ftest1 int, ftest2 inet, FOREIGN KEY(ftest1, ftest2) REFERENCES pktable(ptest2, ptest1)); +ERROR: foreign key constraint "fktable_ftest1_fkey" cannot be implemented +DETAIL: Key columns "ftest1" and "ptest2" are of incompatible types: integer and inet. +-- This works... +CREATE TABLE FKTABLE (ftest1 int, ftest2 inet, FOREIGN KEY(ftest2, ftest1) REFERENCES pktable(ptest2, ptest1)); +DROP TABLE FKTABLE; +-- As does this +CREATE TABLE FKTABLE (ftest1 int, ftest2 inet, FOREIGN KEY(ftest1, ftest2) REFERENCES pktable(ptest1, ptest2)); +DROP TABLE FKTABLE; +DROP TABLE PKTABLE; +-- Two columns, same table +-- Make sure this still works... +CREATE TABLE PKTABLE (ptest1 int, ptest2 inet, ptest3 int, ptest4 inet, PRIMARY KEY(ptest1, ptest2), FOREIGN KEY(ptest3, +ptest4) REFERENCES pktable(ptest1, ptest2)); +NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "pktable_pkey" for table "pktable" +DROP TABLE PKTABLE; +-- And this, +CREATE TABLE PKTABLE (ptest1 int, ptest2 inet, ptest3 int, ptest4 inet, PRIMARY KEY(ptest1, ptest2), FOREIGN KEY(ptest3, +ptest4) REFERENCES pktable); +NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "pktable_pkey" for table "pktable" +DROP TABLE PKTABLE; +-- This shouldn't (mixed up columns) +CREATE TABLE PKTABLE (ptest1 int, ptest2 inet, ptest3 int, ptest4 inet, PRIMARY KEY(ptest1, ptest2), FOREIGN KEY(ptest3, +ptest4) REFERENCES pktable(ptest2, ptest1)); +NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "pktable_pkey" for table "pktable" +ERROR: foreign key constraint "pktable_ptest3_fkey" cannot be implemented +DETAIL: Key columns "ptest3" and "ptest2" are of incompatible types: integer and inet. +-- Nor should this... (same reason, we have 4,3 referencing 1,2 which mismatches types +CREATE TABLE PKTABLE (ptest1 int, ptest2 inet, ptest3 int, ptest4 inet, PRIMARY KEY(ptest1, ptest2), FOREIGN KEY(ptest4, +ptest3) REFERENCES pktable(ptest1, ptest2)); +NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "pktable_pkey" for table "pktable" +ERROR: foreign key constraint "pktable_ptest4_fkey" cannot be implemented +DETAIL: Key columns "ptest4" and "ptest1" are of incompatible types: inet and integer. +-- Not this one either... Same as the last one except we didn't defined the columns being referenced. +CREATE TABLE PKTABLE (ptest1 int, ptest2 inet, ptest3 int, ptest4 inet, PRIMARY KEY(ptest1, ptest2), FOREIGN KEY(ptest4, +ptest3) REFERENCES pktable); +NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "pktable_pkey" for table "pktable" +ERROR: foreign key constraint "pktable_ptest4_fkey" cannot be implemented +DETAIL: Key columns "ptest4" and "ptest1" are of incompatible types: inet and integer. +-- +-- Now some cases with inheritance +-- Basic 2 table case: 1 column of matching types. +create table pktable_base (base1 int not null); +create table pktable (ptest1 int, primary key(base1), unique(base1, ptest1)) inherits (pktable_base); +NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "pktable_pkey" for table "pktable" +NOTICE: CREATE TABLE / UNIQUE will create implicit index "pktable_base1_ptest1_key" for table "pktable" +create table fktable (ftest1 int references pktable(base1)); +-- now some ins, upd, del +insert into pktable(base1) values (1); +insert into pktable(base1) values (2); +-- let's insert a non-existant fktable value +insert into fktable(ftest1) values (3); +ERROR: insert or update on table "fktable" violates foreign key constraint "fktable_ftest1_fkey" +DETAIL: Key (ftest1)=(3) is not present in table "pktable". +-- let's make a valid row for that +insert into pktable(base1) values (3); +insert into fktable(ftest1) values (3); +-- let's try removing a row that should fail from pktable +delete from pktable where base1>2; +ERROR: update or delete on table "pktable" violates foreign key constraint "fktable_ftest1_fkey" on table "fktable" +DETAIL: Key (base1)=(3) is still referenced from table "fktable". +-- okay, let's try updating all of the base1 values to *4 +-- which should fail. +update pktable set base1=base1*4; +ERROR: Partition column can't be updated in current version +-- okay, let's try an update that should work. +update pktable set base1=base1*4 where base1<3; +ERROR: Partition column can't be updated in current version +-- and a delete that should work +delete from pktable where base1>3; +-- cleanup +drop table fktable; +delete from pktable; +-- Now 2 columns 2 tables, matching types +create table fktable (ftest1 int, ftest2 int, foreign key(ftest1, ftest2) references pktable(base1, ptest1)); +-- now some ins, upd, del +insert into pktable(base1, ptest1) values (1, 1); +insert into pktable(base1, ptest1) values (2, 2); +-- let's insert a non-existant fktable value +insert into fktable(ftest1, ftest2) values (3, 1); +ERROR: insert or update on table "fktable" violates foreign key constraint "fktable_ftest1_fkey" +DETAIL: Key (ftest1, ftest2)=(3, 1) is not present in table "pktable". +-- let's make a valid row for that +insert into pktable(base1,ptest1) values (3, 1); +insert into fktable(ftest1, ftest2) values (3, 1); +-- let's try removing a row that should fail from pktable +delete from pktable where base1>2; +ERROR: update or delete on table "pktable" violates foreign key constraint "fktable_ftest1_fkey" on table "fktable" +DETAIL: Key (base1, ptest1)=(3, 1) is still referenced from table "fktable". +-- okay, let's try updating all of the base1 values to *4 +-- which should fail. +update pktable set base1=base1*4; +ERROR: Partition column can't be updated in current version +-- okay, let's try an update that should work. +update pktable set base1=base1*4 where base1<3; +ERROR: Partition column can't be updated in current version +-- and a delete that should work +delete from pktable where base1>3; +-- cleanup +drop table fktable; +drop table pktable; +drop table pktable_base; +-- Now we'll do one all in 1 table with 2 columns of matching types +create table pktable_base(base1 int not null, base2 int); +create table pktable(ptest1 int, ptest2 int, primary key(base1, ptest1), foreign key(base2, ptest2) references + pktable(base1, ptest1)) inherits (pktable_base); +NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "pktable_pkey" for table "pktable" +insert into pktable (base1, ptest1, base2, ptest2) values (1, 1, 1, 1); +insert into pktable (base1, ptest1, base2, ptest2) values (2, 1, 1, 1); +ERROR: insert or update on table "pktable" violates foreign key constraint "pktable_base2_fkey" +DETAIL: Key (base2, ptest2)=(1, 1) is not present in table "pktable". +insert into pktable (base1, ptest1, base2, ptest2) values (2, 2, 2, 1); +ERROR: insert or update on table "pktable" violates foreign key constraint "pktable_base2_fkey" +DETAIL: Key (base2, ptest2)=(2, 1) is not present in table "pktable". +insert into pktable (base1, ptest1, base2, ptest2) values (1, 3, 2, 2); +ERROR: insert or update on table "pktable" violates foreign key constraint "pktable_base2_fkey" +DETAIL: Key (base2, ptest2)=(2, 2) is not present in table "pktable". +-- fails (3,2) isn't in base1, ptest1 +insert into pktable (base1, ptest1, base2, ptest2) values (2, 3, 3, 2); +ERROR: insert or update on table "pktable" violates foreign key constraint "pktable_base2_fkey" +DETAIL: Key (base2, ptest2)=(3, 2) is not present in table "pktable". +-- fails (2,2) is being referenced +delete from pktable where base1=2; +-- fails (1,1) is being referenced (twice) +update pktable set base1=3 where base1=1; +ERROR: Partition column can't be updated in current version +-- this sequence of two deletes will work, since after the first there will be no (2,*) references +delete from pktable where base2=2; +delete from pktable where base1=2; +drop table pktable; +drop table pktable_base; +-- 2 columns (2 tables), mismatched types +create table pktable_base(base1 int not null); +create table pktable(ptest1 inet, primary key(base1, ptest1)) inherits (pktable_base); +NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "pktable_pkey" for table "pktable" +-- just generally bad types (with and without column references on the referenced table) +create table fktable(ftest1 cidr, ftest2 int[], foreign key (ftest1, ftest2) references pktable); +ERROR: foreign key constraint "fktable_ftest1_fkey" cannot be implemented +DETAIL: Key columns "ftest1" and "base1" are of incompatible types: cidr and integer. +create table fktable(ftest1 cidr, ftest2 int[], foreign key (ftest1, ftest2) references pktable(base1, ptest1)); +ERROR: Column ftest1 is not a hash distributable data type +-- let's mix up which columns reference which +create table fktable(ftest1 int, ftest2 inet, foreign key(ftest2, ftest1) references pktable); +ERROR: foreign key constraint "fktable_ftest2_fkey" cannot be implemented +DETAIL: Key columns "ftest2" and "base1" are of incompatible types: inet and integer. +create table fktable(ftest1 int, ftest2 inet, foreign key(ftest2, ftest1) references pktable(base1, ptest1)); +ERROR: Column ftest2 is not a hash distributable data type +create table fktable(ftest1 int, ftest2 inet, foreign key(ftest1, ftest2) references pktable(ptest1, base1)); +ERROR: foreign key constraint "fktable_ftest1_fkey" cannot be implemented +DETAIL: Key columns "ftest1" and "ptest1" are of incompatible types: integer and inet. +drop table pktable; +drop table pktable_base; +-- 2 columns (1 table), mismatched types +create table pktable_base(base1 int not null, base2 int); +create table pktable(ptest1 inet, ptest2 inet[], primary key(base1, ptest1), foreign key(base2, ptest2) references + pktable(base1, ptest1)) inherits (pktable_base); +NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "pktable_pkey" for table "pktable" +ERROR: foreign key constraint "pktable_base2_fkey" cannot be implemented +DETAIL: Key columns "ptest2" and "ptest1" are of incompatible types: inet[] and inet. +create table pktable(ptest1 inet, ptest2 inet, primary key(base1, ptest1), foreign key(base2, ptest2) references + pktable(ptest1, base1)) inherits (pktable_base); +NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "pktable_pkey" for table "pktable" +ERROR: foreign key constraint "pktable_base2_fkey" cannot be implemented +DETAIL: Key columns "base2" and "ptest1" are of incompatible types: integer and inet. +create table pktable(ptest1 inet, ptest2 inet, primary key(base1, ptest1), foreign key(ptest2, base2) references + pktable(base1, ptest1)) inherits (pktable_base); +NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "pktable_pkey" for table "pktable" +ERROR: foreign key constraint "pktable_ptest2_fkey" cannot be implemented +DETAIL: Key columns "ptest2" and "base1" are of incompatible types: inet and integer. +create table pktable(ptest1 inet, ptest2 inet, primary key(base1, ptest1), foreign key(ptest2, base2) references + pktable(base1, ptest1)) inherits (pktable_base); +NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "pktable_pkey" for table "pktable" +ERROR: foreign key constraint "pktable_ptest2_fkey" cannot be implemented +DETAIL: Key columns "ptest2" and "base1" are of incompatible types: inet and integer. +drop table pktable; +ERROR: table "pktable" does not exist +drop table pktable_base; +-- +-- Deferrable constraints +-- (right now, only FOREIGN KEY constraints can be deferred) +-- +-- deferrable, explicitly deferred +CREATE TABLE pktable ( + id INT4 PRIMARY KEY, + other INT4 +); +NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "pktable_pkey" for table "pktable" +CREATE TABLE fktable ( + id INT4 PRIMARY KEY, + fk INT4 REFERENCES pktable DEFERRABLE +); +ERROR: Hash/Modulo distributed table must include distribution column in index +-- default to immediate: should fail +INSERT INTO fktable VALUES (5, 10); +ERROR: relation "fktable" does not exist +LINE 1: INSERT INTO fktable VALUES (5, 10); + ^ +-- explicitly defer the constraint +BEGIN; +SET CONSTRAINTS ALL DEFERRED; +ERROR: Postgres-XC does not support DEFERRED constraints yet +DETAIL: The feature is not currently supported +INSERT INTO fktable VALUES (10, 15); +ERROR: current transaction is aborted, commands ignored until end of transaction block +INSERT INTO pktable VALUES (15, 0); -- make the FK insert valid +ERROR: current transaction is aborted, commands ignored until end of transaction block +COMMIT; +DROP TABLE fktable; +ERROR: table "fktable" does not exist +DROP TABLE pktable; +-- deferrable, initially deferred +CREATE TABLE pktable ( + id INT4 PRIMARY KEY, + other INT4 +); +NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "pktable_pkey" for table "pktable" +CREATE TABLE fktable ( + id INT4 PRIMARY KEY, + fk INT4 REFERENCES pktable DEFERRABLE INITIALLY DEFERRED +); +ERROR: Postgres-XC does not support DEFERRED constraints yet +DETAIL: The feature is not currently supported +-- default to deferred, should succeed +BEGIN; +INSERT INTO fktable VALUES (100, 200); +ERROR: relation "fktable" does not exist +LINE 1: INSERT INTO fktable VALUES (100, 200); + ^ +INSERT INTO pktable VALUES (200, 500); -- make the FK insert valid +ERROR: current transaction is aborted, commands ignored until end of transaction block +COMMIT; +-- default to deferred, explicitly make immediate +BEGIN; +SET CONSTRAINTS ALL IMMEDIATE; +-- should fail +INSERT INTO fktable VALUES (500, 1000); +ERROR: relation "fktable" does not exist +LINE 1: INSERT INTO fktable VALUES (500, 1000); + ^ +COMMIT; +DROP TABLE fktable; +ERROR: table "fktable" does not exist +DROP TABLE pktable; +-- tricky behavior: according to SQL99, if a deferred constraint is set +-- to 'immediate' mode, it should be checked for validity *immediately*, +-- not when the current transaction commits (i.e. the mode change applies +-- retroactively) +CREATE TABLE pktable ( + id INT4 PRIMARY KEY, + other INT4 +); +NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "pktable_pkey" for table "pktable" +CREATE TABLE fktable ( + id INT4 PRIMARY KEY, + fk INT4 REFERENCES pktable DEFERRABLE +); +ERROR: Hash/Modulo distributed table must include distribution column in index +BEGIN; +SET CONSTRAINTS ALL DEFERRED; +ERROR: Postgres-XC does not support DEFERRED constraints yet +DETAIL: The feature is not currently supported +-- should succeed, for now +INSERT INTO fktable VALUES (1000, 2000); +ERROR: current transaction is aborted, commands ignored until end of transaction block +-- should cause transaction abort, due to preceding error +SET CONSTRAINTS ALL IMMEDIATE; +ERROR: current transaction is aborted, commands ignored until end of transaction block +INSERT INTO pktable VALUES (2000, 3); -- too late +ERROR: current transaction is aborted, commands ignored until end of transaction block +COMMIT; +DROP TABLE fktable; +ERROR: table "fktable" does not exist +DROP TABLE pktable; +-- deferrable, initially deferred +CREATE TABLE pktable ( + id INT4 PRIMARY KEY, + other INT4 +); +NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "pktable_pkey" for table "pktable" +CREATE TABLE fktable ( + id INT4 PRIMARY KEY, + fk INT4 REFERENCES pktable DEFERRABLE INITIALLY DEFERRED +); +ERROR: Postgres-XC does not support DEFERRED constraints yet +DETAIL: The feature is not currently supported +BEGIN; +-- no error here +INSERT INTO fktable VALUES (100, 200); +ERROR: relation "fktable" does not exist +LINE 1: INSERT INTO fktable VALUES (100, 200); + ^ +-- error here on commit +COMMIT; +DROP TABLE pktable; +DROP TABLE fktable; +ERROR: table "fktable" does not exist +-- test notice about expensive referential integrity checks, +-- where the index cannot be used because of type incompatibilities. +CREATE TEMP TABLE pktable ( + id1 INT4 PRIMARY KEY, + id2 VARCHAR(4) UNIQUE, + id3 REAL UNIQUE, + UNIQUE(id1, id2, id3) +); +ERROR: PG-XC does not yet support temporary tables +CREATE TEMP TABLE fktable ( + x1 INT4 REFERENCES pktable(id1), + x2 VARCHAR(4) REFERENCES pktable(id2), + x3 REAL REFERENCES pktable(id3), + x4 TEXT, + x5 INT2 +); +ERROR: relation "pktable" does not exist +-- check individual constraints with alter table. +-- should fail +-- varchar does not promote to real +ALTER TABLE fktable ADD CONSTRAINT fk_2_3 +FOREIGN KEY (x2) REFERENCES pktable(id3); +ERROR: relation "fktable" does not exist +-- nor to int4 +ALTER TABLE fktable ADD CONSTRAINT fk_2_1 +FOREIGN KEY (x2) REFERENCES pktable(id1); +ERROR: relation "fktable" does not exist +-- real does not promote to int4 +ALTER TABLE fktable ADD CONSTRAINT fk_3_1 +FOREIGN KEY (x3) REFERENCES pktable(id1); +ERROR: relation "fktable" does not exist +-- int4 does not promote to text +ALTER TABLE fktable ADD CONSTRAINT fk_1_2 +FOREIGN KEY (x1) REFERENCES pktable(id2); +ERROR: relation "fktable" does not exist +-- should succeed +-- int4 promotes to real +ALTER TABLE fktable ADD CONSTRAINT fk_1_3 +FOREIGN KEY (x1) REFERENCES pktable(id3); +ERROR: relation "fktable" does not exist +-- text is compatible with varchar +ALTER TABLE fktable ADD CONSTRAINT fk_4_2 +FOREIGN KEY (x4) REFERENCES pktable(id2); +ERROR: relation "fktable" does not exist +-- int2 is part of integer opfamily as of 8.0 +ALTER TABLE fktable ADD CONSTRAINT fk_5_1 +FOREIGN KEY (x5) REFERENCES pktable(id1); +ERROR: relation "fktable" does not exist +-- check multikey cases, especially out-of-order column lists +-- these should work +ALTER TABLE fktable ADD CONSTRAINT fk_123_123 +FOREIGN KEY (x1,x2,x3) REFERENCES pktable(id1,id2,id3); +ERROR: relation "fktable" does not exist +ALTER TABLE fktable ADD CONSTRAINT fk_213_213 +FOREIGN KEY (x2,x1,x3) REFERENCES pktable(id2,id1,id3); +ERROR: relation "fktable" does not exist +ALTER TABLE fktable ADD CONSTRAINT fk_253_213 +FOREIGN KEY (x2,x5,x3) REFERENCES pktable(id2,id1,id3); +ERROR: relation "fktable" does not exist +-- these should fail +ALTER TABLE fktable ADD CONSTRAINT fk_123_231 +FOREIGN KEY (x1,x2,x3) REFERENCES pktable(id2,id3,id1); +ERROR: relation "fktable" does not exist +ALTER TABLE fktable ADD CONSTRAINT fk_241_132 +FOREIGN KEY (x2,x4,x1) REFERENCES pktable(id1,id3,id2); +ERROR: relation "fktable" does not exist +DROP TABLE pktable; +ERROR: table "pktable" does not exist +DROP TABLE fktable; +ERROR: table "fktable" does not exist +-- test a tricky case: we can elide firing the FK check trigger during +-- an UPDATE if the UPDATE did not change the foreign key +-- field. However, we can't do this if our transaction was the one that +-- created the updated row and the trigger is deferred, since our UPDATE +-- will have invalidated the original newly-inserted tuple, and therefore +-- cause the on-INSERT RI trigger not to be fired. +CREATE TEMP TABLE pktable ( + id int primary key, + other int +); +ERROR: PG-XC does not yet support temporary tables +CREATE TEMP TABLE fktable ( + id int primary key, + fk int references pktable deferrable initially deferred +); +ERROR: Postgres-XC does not support DEFERRED constraints yet +DETAIL: The feature is not currently supported +INSERT INTO pktable VALUES (5, 10); +ERROR: relation "pktable" does not exist +LINE 1: INSERT INTO pktable VALUES (5, 10); + ^ +BEGIN; +-- doesn't match PK, but no error yet +INSERT INTO fktable VALUES (0, 20); +ERROR: relation "fktable" does not exist +LINE 1: INSERT INTO fktable VALUES (0, 20); + ^ +-- don't change FK +UPDATE fktable SET id = id + 1; +ERROR: current transaction is aborted, commands ignored until end of transaction block +-- should catch error from initial INSERT +COMMIT; +-- check same case when insert is in a different subtransaction than update +BEGIN; +-- doesn't match PK, but no error yet +INSERT INTO fktable VALUES (0, 20); +ERROR: relation "fktable" does not exist +LINE 1: INSERT INTO fktable VALUES (0, 20); + ^ +-- UPDATE will be in a subxact +SAVEPOINT savept1; +ERROR: current transaction is aborted, commands ignored until end of transaction block +-- don't change FK +UPDATE fktable SET id = id + 1; +ERROR: current transaction is aborted, commands ignored until end of transaction block +-- should catch error from initial INSERT +COMMIT; +BEGIN; +-- INSERT will be in a subxact +SAVEPOINT savept1; +ERROR: SAVEPOINT is not yet supported. +-- doesn't match PK, but no error yet +INSERT INTO fktable VALUES (0, 20); +ERROR: current transaction is aborted, commands ignored until end of transaction block +RELEASE SAVEPOINT savept1; +ERROR: current transaction is aborted, commands ignored until end of transaction block +-- don't change FK +UPDATE fktable SET id = id + 1; +ERROR: current transaction is aborted, commands ignored until end of transaction block +-- should catch error from initial INSERT +COMMIT; +BEGIN; +-- doesn't match PK, but no error yet +INSERT INTO fktable VALUES (0, 20); +ERROR: relation "fktable" does not exist +LINE 1: INSERT INTO fktable VALUES (0, 20); + ^ +-- UPDATE will be in a subxact +SAVEPOINT savept1; +ERROR: current transaction is aborted, commands ignored until end of transaction block +-- don't change FK +UPDATE fktable SET id = id + 1; +ERROR: current transaction is aborted, commands ignored until end of transaction block +-- Roll back the UPDATE +ROLLBACK TO savept1; +ERROR: no such savepoint +-- should catch error from initial INSERT +COMMIT; +-- test order of firing of FK triggers when several RI-induced changes need to +-- be made to the same row. This was broken by subtransaction-related +-- changes in 8.0. +CREATE TEMP TABLE users ( + id INT PRIMARY KEY, + name VARCHAR NOT NULL +); +ERROR: PG-XC does not yet support temporary tables +INSERT INTO users VALUES (1, 'Jozko'); +ERROR: relation "users" does not exist +LINE 1: INSERT INTO users VALUES (1, 'Jozko'); + ^ +INSERT INTO users VALUES (2, 'Ferko'); +ERROR: relation "users" does not exist +LINE 1: INSERT INTO users VALUES (2, 'Ferko'); + ^ +INSERT INTO users VALUES (3, 'Samko'); +ERROR: relation "users" does not exist +LINE 1: INSERT INTO users VALUES (3, 'Samko'); + ^ +CREATE TEMP TABLE tasks ( + id INT PRIMARY KEY, + owner INT REFERENCES users ON UPDATE CASCADE ON DELETE SET NULL, + worker INT REFERENCES users ON UPDATE CASCADE ON DELETE SET NULL, + checked_by INT REFERENCES users ON UPDATE CASCADE ON DELETE SET NULL +); +ERROR: relation "users" does not exist +INSERT INTO tasks VALUES (1,1,NULL,NULL); +ERROR: relation "tasks" does not exist +LINE 1: INSERT INTO tasks VALUES (1,1,NULL,NULL); + ^ +INSERT INTO tasks VALUES (2,2,2,NULL); +ERROR: relation "tasks" does not exist +LINE 1: INSERT INTO tasks VALUES (2,2,2,NULL); + ^ +INSERT INTO tasks VALUES (3,3,3,3); +ERROR: relation "tasks" does not exist +LINE 1: INSERT INTO tasks VALUES (3,3,3,3); + ^ +SELECT * FROM tasks ORDER BY 1, 2, 3,4; +ERROR: relation "tasks" does not exist +LINE 1: SELECT * FROM tasks ORDER BY 1, 2, 3,4; + ^ +UPDATE users SET id = 4 WHERE id = 3; +ERROR: relation "users" does not exist +LINE 1: UPDATE users SET id = 4 WHERE id = 3; + ^ +SELECT * FROM tasks ORDER BY 1, 2, 3,4; +ERROR: relation "tasks" does not exist +LINE 1: SELECT * FROM tasks ORDER BY 1, 2, 3,4; + ^ +DELETE FROM users WHERE id = 4; +ERROR: relation "users" does not exist +LINE 1: DELETE FROM users WHERE id = 4; + ^ +SELECT * FROM tasks ORDER BY 1, 2, 3,4; +ERROR: relation "tasks" does not exist +LINE 1: SELECT * FROM tasks ORDER BY 1, 2, 3,4; + ^ +-- could fail with only 2 changes to make, if row was already updated +BEGIN; +UPDATE tasks set id=id WHERE id=2; +ERROR: relation "tasks" does not exist +LINE 1: UPDATE tasks set id=id WHERE id=2; + ^ +SELECT * FROM tasks ORDER BY 1, 2, 3,4; +ERROR: current transaction is aborted, commands ignored until end of transaction block +DELETE FROM users WHERE id = 2; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SELECT * FROM tasks ORDER BY 1, 2, 3,4; +ERROR: current transaction is aborted, commands ignored until end of transaction block +COMMIT; diff --git a/src/test/regress/sql/foreign_key.sql b/src/test/regress/sql/foreign_key.sql index 241b2a9..d5cf674 100644 --- a/src/test/regress/sql/foreign_key.sql +++ b/src/test/regress/sql/foreign_key.sql @@ -642,7 +642,8 @@ INSERT INTO pktable VALUES (15, 0); -- make the FK insert valid COMMIT; -DROP TABLE fktable, pktable; +DROP TABLE fktable; +DROP TABLE pktable; -- deferrable, initially deferred CREATE TABLE pktable ( @@ -673,7 +674,8 @@ INSERT INTO fktable VALUES (500, 1000); COMMIT; -DROP TABLE fktable, pktable; +DROP TABLE fktable; +DROP TABLE pktable; -- tricky behavior: according to SQL99, if a deferred constraint is set -- to 'immediate' mode, it should be checked for validity *immediately*, @@ -703,7 +705,8 @@ INSERT INTO pktable VALUES (2000, 3); -- too late COMMIT; -DROP TABLE fktable, pktable; +DROP TABLE fktable; +DROP TABLE pktable; -- deferrable, initially deferred CREATE TABLE pktable ( @@ -724,7 +727,8 @@ INSERT INTO fktable VALUES (100, 200); -- error here on commit COMMIT; -DROP TABLE pktable, fktable; +DROP TABLE pktable; +DROP TABLE fktable; -- test notice about expensive referential integrity checks, -- where the index cannot be used because of type incompatibilities. @@ -799,7 +803,8 @@ FOREIGN KEY (x1,x2,x3) REFERENCES pktable(id2,id3,id1); ALTER TABLE fktable ADD CONSTRAINT fk_241_132 FOREIGN KEY (x2,x4,x1) REFERENCES pktable(id1,id3,id2); -DROP TABLE pktable, fktable; +DROP TABLE pktable; +DROP TABLE fktable; -- test a tricky case: we can elide firing the FK check trigger during -- an UPDATE if the UPDATE did not change the foreign key ----------------------------------------------------------------------- Summary of changes: .../{foreign_key.out => foreign_key_1.out} | 318 ++++++++++++-------- src/test/regress/sql/foreign_key.sql | 15 +- 2 files changed, 200 insertions(+), 133 deletions(-) copy src/test/regress/expected/{foreign_key.out => foreig... [truncated message content] |
From: Michael P. <mic...@us...> - 2011-04-12 01:44:11
|
Project "Postgres-XC". The branch, master has been updated via ac25b331910b55892b3bfcecde7255471bd3622c (commit) from 1ca81ca5d9f7c7d257b87654e9c50a3913fe6cfe (commit) - Log ----------------------------------------------------------------- commit ac25b331910b55892b3bfcecde7255471bd3622c Author: Michael P <mic...@us...> Date: Tue Apr 12 10:38:17 2011 +0900 Support for ALTER DEFAULT PRIVILEGES This query was not treated on all the nodes of the cluster. diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index f2767ec..98d19fa 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -1107,6 +1107,11 @@ standard_ProcessUtility(Node *parsetree, case T_AlterDefaultPrivilegesStmt: ExecAlterDefaultPrivilegesStmt((AlterDefaultPrivilegesStmt *) parsetree); + +#ifdef PGXC + if (IS_PGXC_COORDINATOR) + ExecUtilityStmtOnNodes(queryString, NULL, false, EXEC_ON_ALL_NODES); +#endif break; /* ----------------------------------------------------------------------- Summary of changes: src/backend/tcop/utility.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-04-12 01:37:30
|
Project "Postgres-XC". The branch, master has been updated via 1ca81ca5d9f7c7d257b87654e9c50a3913fe6cfe (commit) from bf5d482ef08bf914c4562fe3ce33fc7cc54666e6 (commit) - Log ----------------------------------------------------------------- commit 1ca81ca5d9f7c7d257b87654e9c50a3913fe6cfe Author: Michael P <mic...@us...> Date: Tue Apr 12 10:33:02 2011 +0900 Support for ALTER .. OWNER TO This SQL query was not treated on all the nodes. diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index 8edffc0..f2767ec 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -926,6 +926,11 @@ standard_ProcessUtility(Node *parsetree, case T_AlterOwnerStmt: ExecAlterOwnerStmt((AlterOwnerStmt *) parsetree); + +#ifdef PGXC + if (IS_PGXC_COORDINATOR) + ExecUtilityStmtOnNodes(queryString, NULL, false, EXEC_ON_ALL_NODES); +#endif break; case T_AlterTableStmt: ----------------------------------------------------------------------- Summary of changes: src/backend/tcop/utility.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-04-12 01:05:53
|
Project "Postgres-XC". The branch, master has been updated via bf5d482ef08bf914c4562fe3ce33fc7cc54666e6 (commit) from 175ff49e7d19a4205de0a200ba78c86a1fd46a6c (commit) - Log ----------------------------------------------------------------- commit bf5d482ef08bf914c4562fe3ce33fc7cc54666e6 Author: Michael P <mic...@us...> Date: Tue Apr 12 10:01:10 2011 +0900 Fix for bug 3284898: comment on a rule applying to a view Block comment on rules for the time being. Rules are created only on Coordinators (for views) and on all nodes for other relations. diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index 28a43c2..8edffc0 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -819,6 +819,17 @@ standard_ProcessUtility(Node *parsetree, if (stmt->objtype == OBJECT_SEQUENCE || stmt->objtype == OBJECT_VIEW) ExecUtilityStmtOnNodes(queryString, NULL, false, EXEC_ON_COORDS); + else if (stmt->objtype == OBJECT_RULE) + { + /* + * Sometimes rules are created only on Coordinator (views), sometimes + * on all nodes (other relations), so block it for the moment. + */ + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("Postgres-XC does not support COMMENT on RULE yet"), + errdetail("The feature is not currently supported"))); + } else ExecUtilityStmtOnNodes(queryString, NULL, false, EXEC_ON_ALL_NODES); } ----------------------------------------------------------------------- Summary of changes: src/backend/tcop/utility.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-04-12 00:15:41
|
Project "Postgres-XC". The branch, master has been updated via 175ff49e7d19a4205de0a200ba78c86a1fd46a6c (commit) from 7f0ec79b75ca3836569d6a60cedc55665d74ec20 (commit) - Log ----------------------------------------------------------------- commit 175ff49e7d19a4205de0a200ba78c86a1fd46a6c Author: Michael P <mic...@us...> Date: Tue Apr 12 08:58:28 2011 +0900 Fix for regression output and SQL files It wasn't taken into account that some output files change depending on the system regression is launched. diff --git a/src/test/regress/expected/copy_1.out b/src/test/regress/expected/copy_1.out deleted file mode 100644 index 80a0ea4..0000000 --- a/src/test/regress/expected/copy_1.out +++ /dev/null @@ -1,99 +0,0 @@ --- --- COPY --- --- CLASS POPULATION --- (any resemblance to real life is purely coincidental) --- -COPY aggtest FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/agg.data'; -COPY onek FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/onek.data'; -COPY onek TO '/home/abbas/pgxc/postgres-xc/src/test/regress/results/onek.data'; -DELETE FROM onek; -COPY onek FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/results/onek.data'; -COPY tenk1 FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/tenk.data'; -COPY slow_emp4000 FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/rect.data'; -COPY person FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/person.data'; -COPY emp FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/emp.data'; -COPY student FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/student.data'; -COPY stud_emp FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/stud_emp.data'; -COPY road FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/streets.data'; -COPY real_city FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/real_city.data'; -COPY hash_i4_heap FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/hash.data'; -COPY hash_name_heap FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/hash.data'; -COPY hash_txt_heap FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/hash.data'; -COPY hash_f8_heap FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/hash.data'; -COPY test_tsvector FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/tsearch.data'; --- the data in this file has a lot of duplicates in the index key --- fields, leading to long bucket chains and lots of table expansion. --- this is therefore a stress test of the bucket overflow code (unlike --- the data in hash.data, which has unique index keys). --- --- COPY hash_ovfl_heap FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/hashovfl.data'; -COPY bt_i4_heap FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/desc.data'; -COPY bt_name_heap FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/hash.data'; -COPY bt_txt_heap FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/desc.data'; -COPY bt_f8_heap FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/hash.data'; -COPY array_op_test FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/array.data'; -COPY array_index_op_test FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/array.data'; ---- test copying in CSV mode with various styles ---- of embedded line ending characters -create temp table copytest ( - style text, - test text, - filler int); -ERROR: PG-XC does not yet support temporary tables -insert into copytest values('DOS',E'abc\r\ndef',1); -ERROR: relation "copytest" does not exist -LINE 1: insert into copytest values('DOS',E'abc\r\ndef',1); - ^ -insert into copytest values('Unix',E'abc\ndef',2); -ERROR: relation "copytest" does not exist -LINE 1: insert into copytest values('Unix',E'abc\ndef',2); - ^ -insert into copytest values('Mac',E'abc\rdef',3); -ERROR: relation "copytest" does not exist -LINE 1: insert into copytest values('Mac',E'abc\rdef',3); - ^ -insert into copytest values(E'esc\\ape',E'a\\r\\\r\\\n\\nb',4); -ERROR: relation "copytest" does not exist -LINE 1: insert into copytest values(E'esc\\ape',E'a\\r\\\r\\\n\\nb',... - ^ -copy copytest to '/home/abbas/pgxc/postgres-xc/src/test/regress/results/copytest.csv' csv; -ERROR: relation "copytest" does not exist -create temp table copytest2 (like copytest); -ERROR: relation "copytest" does not exist -LINE 1: create temp table copytest2 (like copytest); - ^ -copy copytest2 from '/home/abbas/pgxc/postgres-xc/src/test/regress/results/copytest.csv' csv; -ERROR: relation "copytest2" does not exist -select * from copytest except select * from copytest2; -ERROR: relation "copytest" does not exist -LINE 1: select * from copytest except select * from copytest2; - ^ -truncate copytest2; -ERROR: relation "copytest2" does not exist ---- same test but with an escape char different from quote char -copy copytest to '/home/abbas/pgxc/postgres-xc/src/test/regress/results/copytest.csv' csv quote '''' escape E'\\'; -ERROR: relation "copytest" does not exist -copy copytest2 from '/home/abbas/pgxc/postgres-xc/src/test/regress/results/copytest.csv' csv quote '''' escape E'\\'; -ERROR: relation "copytest2" does not exist -select * from copytest except select * from copytest2; -ERROR: relation "copytest" does not exist -LINE 1: select * from copytest except select * from copytest2; - ^ --- test header line feature -create temp table copytest3 ( - c1 int, - "col with , comma" text, - "col with "" quote" int); -ERROR: PG-XC does not yet support temporary tables -copy copytest3 from stdin csv header; -ERROR: relation "copytest3" does not exist -this is just a line full of junk that would error out if parsed -1,a,1 -2,b,2 -\. -invalid command \. -copy copytest3 to stdout csv header; -ERROR: syntax error at or near "this" -LINE 1: this is just a line full of junk that would error out if par... - ^ diff --git a/src/test/regress/sql/create_misc.sql b/src/test/regress/input/create_misc.source similarity index 98% rename from src/test/regress/sql/create_misc.sql rename to src/test/regress/input/create_misc.source index 3bfb242..30c5ade 100644 --- a/src/test/regress/sql/create_misc.sql +++ b/src/test/regress/input/create_misc.source @@ -29,7 +29,7 @@ CREATE TABLE onek2 ( string4 name ); -COPY onek2 FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/onek.data'; +COPY onek2 FROM '@abs_srcdir@/data/onek.data'; INSERT INTO fast_emp4000 SELECT * FROM slow_emp4000; diff --git a/src/test/regress/output/copy_1.source b/src/test/regress/output/copy_1.source index be49c09..5324b1f 100644 --- a/src/test/regress/output/copy_1.source +++ b/src/test/regress/output/copy_1.source @@ -15,7 +15,6 @@ COPY person FROM '@abs_srcdir@/data/person.data'; COPY emp FROM '@abs_srcdir@/data/emp.data'; COPY student FROM '@abs_srcdir@/data/student.data'; COPY stud_emp FROM '@abs_srcdir@/data/stud_emp.data'; -ERROR: relation "stud_emp" does not exist COPY road FROM '@abs_srcdir@/data/streets.data'; COPY real_city FROM '@abs_srcdir@/data/real_city.data'; COPY hash_i4_heap FROM '@abs_srcdir@/data/hash.data'; diff --git a/src/test/regress/expected/create_misc_1.out b/src/test/regress/output/create_misc_1.source similarity index 98% rename from src/test/regress/expected/create_misc_1.out rename to src/test/regress/output/create_misc_1.source index 4fa9e62..53fbf2e 100644 --- a/src/test/regress/expected/create_misc_1.out +++ b/src/test/regress/output/create_misc_1.source @@ -25,7 +25,7 @@ CREATE TABLE onek2 ( stringu2 name, string4 name ); -COPY onek2 FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/onek.data'; +COPY onek2 FROM '@abs_srcdir@/data/onek.data'; INSERT INTO fast_emp4000 SELECT * FROM slow_emp4000; SELECT * INTO TABLE Bprime diff --git a/src/test/regress/expected/misc_1.out b/src/test/regress/output/misc_1.source similarity index 96% rename from src/test/regress/expected/misc_1.out rename to src/test/regress/output/misc_1.source index 322fd26..1c8e7af 100644 --- a/src/test/regress/expected/misc_1.out +++ b/src/test/regress/output/misc_1.source @@ -50,9 +50,9 @@ ERROR: table "tmp" does not exist -- -- copy -- -COPY onek TO '/home/abbas/pgxc/postgres-xc/src/test/regress/results/onek.data'; +COPY onek TO '@abs_builddir@/results/onek.data'; DELETE FROM onek; -COPY onek FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/results/onek.data'; +COPY onek FROM '@abs_builddir@/results/onek.data'; SELECT unique1 FROM onek WHERE unique1 < 2 ORDER BY unique1; unique1 --------- @@ -61,7 +61,7 @@ SELECT unique1 FROM onek WHERE unique1 < 2 ORDER BY unique1; (2 rows) DELETE FROM onek2; -COPY onek2 FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/results/onek.data'; +COPY onek2 FROM '@abs_builddir@/results/onek.data'; SELECT unique1 FROM onek2 WHERE unique1 < 2 ORDER BY unique1; unique1 --------- @@ -69,9 +69,9 @@ SELECT unique1 FROM onek2 WHERE unique1 < 2 ORDER BY unique1; 1 (2 rows) -COPY BINARY stud_emp TO '/home/abbas/pgxc/postgres-xc/src/test/regress/results/stud_emp.data'; +COPY BINARY stud_emp TO '@abs_builddir@/results/stud_emp.data'; DELETE FROM stud_emp; -COPY BINARY stud_emp FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/results/stud_emp.data'; +COPY BINARY stud_emp FROM '@abs_builddir@/results/stud_emp.data'; ERROR: Error while running COPY SELECT * FROM stud_emp ORDER BY 1,2; name | age | location | salary | manager | gpa | percent ----------------------------------------------------------------------- Summary of changes: src/test/regress/expected/copy_1.out | 99 -------------------- .../create_misc.sql => input/create_misc.source} | 2 +- src/test/regress/output/copy_1.source | 1 - .../create_misc_1.source} | 2 +- .../{expected/misc_1.out => output/misc_1.source} | 10 +- 5 files changed, 7 insertions(+), 107 deletions(-) delete mode 100644 src/test/regress/expected/copy_1.out rename src/test/regress/{sql/create_misc.sql => input/create_misc.source} (98%) rename src/test/regress/{expected/create_misc_1.out => output/create_misc_1.source} (98%) rename src/test/regress/{expected/misc_1.out => output/misc_1.source} (96%) hooks/post-receive -- Postgres-XC |