Merge remote-tracking branch 'remotes/PGSQL/master' of PG 10
authorPavan Deolasee <pavan.deolasee@gmail.com>
Thu, 13 Jul 2017 09:22:22 +0000 (14:52 +0530)
committerPavan Deolasee <pavan.deolasee@gmail.com>
Thu, 13 Jul 2017 09:22:22 +0000 (14:52 +0530)
This merge includes all commits upto bc2d716ad09fceeb391c755f78c256ddac9d3b9f
of PG 10.

42 files changed:
1  2 
configure
configure.in
doc/bug.template
doc/src/sgml/config.sgml
doc/src/sgml/high-availability.sgml
doc/src/sgml/libpq.sgml
doc/src/sgml/ref/create_trigger.sgml
doc/src/sgml/ref/pg_ctl-ref.sgml
doc/src/sgml/regress.sgml
doc/src/sgml/sourcerepo.sgml
src/backend/access/heap/heapam.c
src/backend/access/transam/xlog.c
src/backend/commands/copy.c
src/backend/commands/tablecmds.c
src/backend/commands/trigger.c
src/backend/executor/execMain.c
src/backend/executor/nodeModifyTable.c
src/backend/main/main.c
src/backend/nodes/outfuncs.c
src/backend/nodes/readfuncs.c
src/backend/parser/parse_agg.c
src/backend/postmaster/postmaster.c
src/backend/replication/syncrep.c
src/backend/rewrite/rewriteHandler.c
src/backend/utils/adt/ruleutils.c
src/backend/utils/init/miscinit.c
src/backend/utils/sort/tuplesort.c
src/bin/pg_ctl/pg_ctl.c
src/bin/pg_dump/pg_dump.c
src/bin/psql/tab-complete.c
src/include/commands/trigger.h
src/include/miscadmin.h
src/include/nodes/execnodes.h
src/include/pg_config.h.win32
src/include/port.h
src/test/regress/expected/create_table.out
src/test/regress/expected/domain.out
src/test/regress/expected/plpgsql.out
src/test/regress/expected/triggers.out
src/test/regress/sql/domain.sql
src/test/regress/sql/plpgsql.sql
src/test/regress/sql/triggers.sql

diff --cc configure
index 338a398e8ac69d895c2684cde81478bf735fe36d,aff72eb00866f0ffab899c227ac612271297a87d..60dca605f735992fdab0350d733675db4314676f
+++ b/configure
@@@ -1,8 -1,8 +1,8 @@@
  #! /bin/sh
  # Guess values for system-dependent variables and create Makefiles.
- # Generated by GNU Autoconf 2.69 for PostgreSQL 10beta1 (Postgres-XL 10alpha1).
 -# Generated by GNU Autoconf 2.69 for PostgreSQL 10beta2.
++# Generated by GNU Autoconf 2.69 for PostgreSQL 10beta2 (Postgres-XL 10alpha1).
  #
 -# Report bugs to <pgsql-bugs@postgresql.org>.
 +# Report bugs to <bugs@postgres-xl.org>.
  #
  #
  # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@@ -582,10 -582,9 +582,10 @@@ MAKEFLAGS
  # Identity of this package.
  PACKAGE_NAME='PostgreSQL'
  PACKAGE_TARNAME='postgresql'
- PACKAGE_VERSION='10beta1 (Postgres-XL 10alpha1)'
 -PACKAGE_VERSION='10beta2'
 -PACKAGE_STRING='PostgreSQL 10beta2'
 -PACKAGE_BUGREPORT='pgsql-bugs@postgresql.org'
++PACKAGE_VERSION='10beta2 (Postgres-XL 10alpha1)'
 +PACKAGE_XC_VERSION='10alpha1'
- PACKAGE_STRING='PostgreSQL 10beta1 (Postgres-XL 10alpha1)'
++PACKAGE_STRING='PostgreSQL 10beta2 (Postgres-XL 10alpha1)'
 +PACKAGE_BUGREPORT='bugs@postgres-xl.org'
  PACKAGE_URL=''
  
  ac_unique_file="src/backend/access/common/heaptuple.c"
@@@ -1412,7 -1408,7 +1412,7 @@@ if test "$ac_init_help" = "long"; the
    # Omit some internal or obsolete options to make the list less imposing.
    # This message is too long to be a string in the A/UX 3.1 sh.
    cat <<_ACEOF
- \`configure' configures PostgreSQL 10beta1 (Postgres-XL 10alpha1) to adapt to many kinds of systems.
 -\`configure' configures PostgreSQL 10beta2 to adapt to many kinds of systems.
++\`configure' configures PostgreSQL 10beta2 (Postgres-XL 10alpha1) to adapt to many kinds of systems.
  
  Usage: $0 [OPTION]... [VAR=VALUE]...
  
  
  if test -n "$ac_init_help"; then
    case $ac_init_help in
-      short | recursive ) echo "Configuration of PostgreSQL 10beta1 (Postgres-XL 10alpha1):";;
 -     short | recursive ) echo "Configuration of PostgreSQL 10beta2:";;
++     short | recursive ) echo "Configuration of PostgreSQL 10beta2 (Postgres-XL 10alpha1):";;
     esac
    cat <<\_ACEOF
  
  test -n "$ac_init_help" && exit $ac_status
  if $ac_init_version; then
    cat <<\_ACEOF
- PostgreSQL configure 10beta1 (Postgres-XL 10alpha1)
 -PostgreSQL configure 10beta2
++PostgreSQL configure 10beta2 (Postgres-XL 10alpha1)
  generated by GNU Autoconf 2.69
  
  Copyright (C) 2012 Free Software Foundation, Inc.
@@@ -2347,7 -2343,7 +2347,7 @@@ cat >config.log <<_ACEO
  This file contains any messages produced by compilers while
  running configure, to aid debugging if configure makes a mistake.
  
- It was created by PostgreSQL $as_me 10beta1 (Postgres-XL 10alpha1), which was
 -It was created by PostgreSQL $as_me 10beta2, which was
++It was created by PostgreSQL $as_me 10beta2 (Postgres-XL 10alpha1), which was
  generated by GNU Autoconf 2.69.  Invocation command line was
  
    $ $0 $@
@@@ -17147,7 -17097,7 +17147,7 @@@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wr
  # report actual input values of CONFIG_FILES etc. instead of their
  # values after options handling.
  ac_log="
- This file was extended by PostgreSQL $as_me 10beta1 (Postgres-XL 10alpha1), which was
 -This file was extended by PostgreSQL $as_me 10beta2, which was
++This file was extended by PostgreSQL $as_me 10beta2 (Postgres-XL 10alpha1), which was
  generated by GNU Autoconf 2.69.  Invocation command line was
  
    CONFIG_FILES    = $CONFIG_FILES
@@@ -17217,7 -17167,7 +17217,7 @@@ _ACEO
  cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
  ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
  ac_cs_version="\\
- PostgreSQL config.status 10beta1 (Postgres-XL 10alpha1)
 -PostgreSQL config.status 10beta2
++PostgreSQL config.status 10beta2 (Postgres-XL 10alpha1)
  configured by $0, generated by GNU Autoconf 2.69,
    with options \\"\$ac_cs_config\\"
  
diff --cc configure.in
index ab71577598b88aa696d6d9df96f01991c603bdde,72e5b17ea747afe52cafc0327414ed36bffbcba0..21c8384bf061456014be57486cd57834b602f07f
@@@ -17,7 -17,7 +17,7 @@@ dnl Read the Autoconf manual for detail
  dnl
  m4_pattern_forbid(^PGAC_)dnl to catch undefined macros
  
- AC_INIT([PostgreSQL], [10beta1 (Postgres-XL 10alpha1)], [bugs@postgres-xl.org])
 -AC_INIT([PostgreSQL], [10beta2], [pgsql-bugs@postgresql.org])
++AC_INIT([PostgreSQL], [10beta2 (Postgres-XL 10alpha1)], [bugs@postgres-xl.org])
  
  m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.69], [], [m4_fatal([Autoconf version 2.69 is required.
  Untested combinations of 'autoconf' and PostgreSQL versions are not
index d4d5f4d4f2006d5e1b69430bdf3d3474ce24b4f5,b37dd33a2f3d3aadd781f35d4935e64825024ff1..1b9a4b7c605c202513a4d36af521bf2d8287563b
@@@ -27,7 -27,7 +27,7 @@@ System Configuration
  
    Operating System (example: Linux 2.4.18)    :
  
-   PostgreSQL version (example: PostgreSQL 10beta1):  Postgres-XL 10alpha1
 -  PostgreSQL version (example: PostgreSQL 10beta2):  PostgreSQL 10beta2
++  PostgreSQL version (example: PostgreSQL 10beta2):  Postgres-XL 10alpha1
  
    Compiler used (example: gcc 3.3.5)          :
  
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 3f692b644155182a261a4752258c50b9577386ba,fc5f4f66ead1ff92bec1d01f6a66a4c28875dd46..37d9a898cf0f8102052010c2c7593154d848d227
@@@ -1485,32 -1444,29 +1493,54 @@@ BeginCopy(ParseState *pstate
                        cstate->num_partitions = num_partitions;
                        cstate->partition_tupconv_maps = partition_tupconv_maps;
                        cstate->partition_tuple_slot = partition_tuple_slot;
+                       /*
+                        * If we are capturing transition tuples, they may need to be
+                        * converted from partition format back to partitioned table
+                        * format (this is only ever necessary if a BEFORE trigger
+                        * modifies the tuple).
+                        */
+                       if (cstate->transition_capture != NULL)
+                       {
+                               int             i;
+                               cstate->transition_tupconv_maps = (TupleConversionMap **)
+                                       palloc0(sizeof(TupleConversionMap *) *
+                                                       cstate->num_partitions);
+                               for (i = 0; i < cstate->num_partitions; ++i)
+                               {
+                                       cstate->transition_tupconv_maps[i] =
+                                               convert_tuples_by_name(RelationGetDescr(cstate->partitions[i].ri_RelationDesc),
+                                                                                          RelationGetDescr(rel),
+                                                                                          gettext_noop("could not convert row type"));
+                               }
+                       }
                }
 +#ifdef PGXC
 +              /* Get copy statement and execution node information */
 +              if (IS_PGXC_COORDINATOR)
 +              {
 +                      RemoteCopyData *remoteCopyState = (RemoteCopyData *) palloc0(sizeof(RemoteCopyData));
 +                      List *attnums = CopyGetAttnums(tupDesc, cstate->rel, attnamelist);
 +
 +                      /* Setup correct COPY FROM/TO flag */
 +                      remoteCopyState->is_from = is_from;
 +
 +                      /* Get execution node list */
 +                      RemoteCopy_GetRelationLoc(remoteCopyState,
 +                                                                        cstate->rel,
 +                                                                        attnums);
 +                      /* Build remote query */
 +                      RemoteCopy_BuildStatement(remoteCopyState,
 +                                                                        cstate->rel,
 +                                                                        GetRemoteCopyOptions(cstate),
 +                                                                        attnamelist,
 +                                                                        attnums);
 +
 +                      /* Then assign built structure */
 +                      cstate->remoteCopyState = remoteCopyState;
 +              }
 +#endif
        }
        else
        {
Simple merge
index 8f6de3fc692a43c13245f0e5b2d392f9d034103b,b502941b08bdfd527529ba0c79b9aa1d1da14953..576fa19705cad251d8973389c646619bc1ed9abe
@@@ -100,12 -97,10 +101,13 @@@ static HeapTuple ExecCallTriggerFunc(Tr
  static void AfterTriggerSaveEvent(EState *estate, ResultRelInfo *relinfo,
                                          int event, bool row_trigger,
                                          HeapTuple oldtup, HeapTuple newtup,
-                                         List *recheckIndexes, Bitmapset *modifiedCols);
+                                         List *recheckIndexes, Bitmapset *modifiedCols,
+                                         TransitionCaptureState *transition_capture);
  static void AfterTriggerEnlargeQueryState(void);
  
 +#ifdef XCP
 +bool enable_datanode_row_triggers;
 +#endif
  
  /*
   * Create a trigger.  Returns the address of the created trigger.
Simple merge
Simple merge
index ec1b467ce32964c3d52cd7125ad1a21ce15357ff,b0abe9ec10ff1a2a5ca3a39dee7105645830531c..6e83eeb219545424528d6bcfcbbefb029c7a12ae
  #include "nodes/extensible.h"
  #include "nodes/plannodes.h"
  #include "nodes/relation.h"
 +#ifdef XCP
 +#include "fmgr.h"
 +#include "miscadmin.h"
 +#include "catalog/namespace.h"
 +#include "pgxc/execRemote.h"
 +#include "utils/lsyscache.h"
 +#endif
  #include "utils/datum.h"
 +#ifdef PGXC
 +#include "pgxc/planner.h"
 +#endif
 +
 +#ifdef XCP
 +/*
 + * When we sending query plans between nodes we need to send OIDs of various
 + * objects - relations, data types, functions, etc.
 + * On different nodes OIDs of these objects may differ, so we need to send an
 + * identifier, depending on object type, allowing to lookup OID on target node.
 + * On the other hand we want to save space when storing rules, or in other cases
 + * when we need to encode and decode nodes on the same node.
 + * For now default format is not portable, as it is in original Postgres code.
 + * Later we may want to add extra parameter in nodeToString() function
 + */
 +static bool portable_output = false;
 +void
 +set_portable_output(bool value)
 +{
 +      portable_output = value;
 +}
 +#endif
  #include "utils/rel.h"
  
+ static void outChar(StringInfo str, char c);
  
  /*
   * Macros to simplify output of different kinds of fields.  Use these
Simple merge
Simple merge
index d25ea8826afe8fe4326308d50932e088f8e4a51d,95180b2ef5977682efb442673890d2ce719f1ff5..583251b65186e493795a65532a7f34c2715dd5b8
  #include "utils/datetime.h"
  #include "utils/dynamic_loader.h"
  #include "utils/memutils.h"
+ #include "utils/pidfile.h"
  #include "utils/ps_status.h"
 +#ifdef PGXC
 +#include "utils/resowner.h"
 +#endif
  #include "utils/timeout.h"
  #include "utils/varlena.h"
  
index 8211ceda20a8a2772e49c081541fcbe89552c91f,77e80f161233774585dfd69a772f9278deab581b..b832a342ea5a754985c508f64604fa7832625eff
@@@ -293,16 -293,12 +293,19 @@@ SyncRepWaitForLSN(XLogRecPtr lsn, bool 
         * WalSender has checked our LSN and has removed us from queue. Clean up
         * state and leave.  It's OK to reset these shared memory fields without
         * holding SyncRepLock, because any walsenders will ignore us anyway when
-        * we're not on the queue.
+        * we're not on the queue.  We need a read barrier to make sure we see
+        * the changes to the queue link (this might be unnecessary without
+        * assertions, but better safe than sorry).
         */
+       pg_read_barrier();
 +#ifdef NOT_USED       
 +      /*
 +       * We are hitting this Assert too often in our tests. This is a PG bug and
 +       * has been reported to the list. But turn this off until it gets fixed in
 +       * the upstream branch
 +       */
        Assert(SHMQueueIsDetached(&(MyProc->syncRepLinks)));
 +#endif        
        MyProc->syncRepState = SYNC_REP_NOT_WAITING;
        MyProc->waitLSN = 0;
  
Simple merge
Simple merge
index dc622219f0068527d3bcf5786997037dfe2f78f7,afbf8f86919fd4d742e8faa68a49b3cace1cf003..18adb618315a92221391e00ed28de5569c31fa29
  #include "utils/builtins.h"
  #include "utils/guc.h"
  #include "utils/memutils.h"
 +#ifdef XCP
 +#include "utils/snapmgr.h"
 +#endif
+ #include "utils/pidfile.h"
  #include "utils/syscache.h"
 +#include "utils/lsyscache.h"
  #include "utils/varlena.h"
  
  
Simple merge
Simple merge
Simple merge
index f1e1920c69ee0e1621b6b043fa465152443bfc73,e9fdc908c71de88b92726c4ed800b11bb0ebd384..cc8a5d0d979e5e88de0b05452cfdf898b823999b
@@@ -1546,39 -1531,19 +1546,31 @@@ psql_completion(const char *text, int s
                else
                        COMPLETE_WITH_FUNCTION_ARG(prev2_wd);
        }
 +
 +      /* ALTER NODE */
 +      else if (Matches2("ALTER", "NODE"))
 +              COMPLETE_WITH_QUERY(Query_for_list_of_available_nodenames);
 +      else if (Matches2("ALTER", "NODE"))
 +              COMPLETE_WITH_CONST("WITH");
 +      else if (Matches3("ALTER", "NODE", "WITH"))
 +              COMPLETE_WITH_CONST("(");
 +      else if (Matches3("ALTER", "NODE", "WITH"))
 +
 +              COMPLETE_WITH_LIST5("TYPE", "HOST", "PORT", "PRIMARY", "PREFERRED");
 +
        /* ALTER PUBLICATION <name> */
        else if (Matches3("ALTER", "PUBLICATION", MatchAny))
-       {
                COMPLETE_WITH_LIST5("ADD TABLE", "DROP TABLE", "OWNER TO", "RENAME TO", "SET");
-       }
        /* ALTER PUBLICATION <name> SET */
        else if (Matches4("ALTER", "PUBLICATION", MatchAny, "SET"))
-       {
                COMPLETE_WITH_LIST2("(", "TABLE");
-       }
        /* ALTER PUBLICATION <name> SET ( */
        else if (HeadMatches3("ALTER", "PUBLICATION", MatchAny) && TailMatches2("SET", "("))
-       {
                COMPLETE_WITH_CONST("publish");
-       }
        /* ALTER SUBSCRIPTION <name> */
        else if (Matches3("ALTER", "SUBSCRIPTION", MatchAny))
-       {
                COMPLETE_WITH_LIST7("CONNECTION", "ENABLE", "DISABLE", "OWNER TO",
                                                        "RENAME TO", "REFRESH PUBLICATION", "SET");
-       }
        /* ALTER SUBSCRIPTION <name> REFRESH PUBLICATION */
        else if (HeadMatches3("ALTER", "SUBSCRIPTION", MatchAny) &&
                         TailMatches2("REFRESH", "PUBLICATION"))
Simple merge
index 58feafd91948b4192b903ae18493802b2a844e11,dad98de98d7c3560411032d5aa54a76170163c3a..586922b579cf3cd9fd35526aaf409cdac3599685
@@@ -445,33 -429,7 +443,8 @@@ extern char *session_preload_libraries_
  extern char *shared_preload_libraries_string;
  extern char *local_preload_libraries_string;
  
- /*
-  * As of 9.1, the contents of the data-directory lock file are:
-  *
-  * line #
-  *            1       postmaster PID (or negative of a standalone backend's PID)
-  *            2       data directory path
-  *            3       postmaster start timestamp (time_t representation)
-  *            4       port number
-  *            5       first Unix socket directory path (empty if none)
-  *            6       first listen_address (IP address or "*"; empty if no TCP port)
-  *            7       shared memory key (not present on Windows)
-  *
-  * Lines 6 and up are added via AddToDataDirLockFile() after initial file
-  * creation.
-  *
-  * The socket lock file, if used, has the same contents as lines 1-5.
-  */
- #define LOCK_FILE_LINE_PID                    1
- #define LOCK_FILE_LINE_DATA_DIR               2
- #define LOCK_FILE_LINE_START_TIME     3
- #define LOCK_FILE_LINE_PORT                   4
- #define LOCK_FILE_LINE_SOCKET_DIR     5
- #define LOCK_FILE_LINE_LISTEN_ADDR    6
- #define LOCK_FILE_LINE_SHMEM_KEY      7
  extern void CreateDataDirLockFile(bool amPostmaster);
 +extern void ForgetLockFiles(void);
  extern void CreateSocketLockFile(const char *socketfile, bool amPostmaster,
                                         const char *socketDir);
  extern void TouchSocketLockFiles(void);
Simple merge
index d7cd0ac4f6f8576bed1594c8f3364852423b75e3,baf57fa9693a2eb7083bc553f2f5f4aa7e080698..16bfb3bc5c408056974f3813d802c1ce3227e96e
  #define MEMSET_LOOP_LIMIT 1024
  
  /* Define to the address where bug reports for this package should be sent. */
 -#define PACKAGE_BUGREPORT "pgsql-bugs@postgresql.org"
 +#define PACKAGE_BUGREPORT "postgres-xl-bugs@lists.sourceforge.net"
  
  /* Define to the full name of this package. */
 -#define PACKAGE_NAME "PostgreSQL"
 +#define PACKAGE_NAME "Postgres-XL"
  
  /* Define to the full name and version of this package. */
 -#define PACKAGE_STRING "PostgreSQL 10beta2"
 +#define PACKAGE_STRING "Postgres-XL 10alpha1"
  
  /* Define to the version of this package. */
- #define PACKAGE_VERSION "10beta1"
+ #define PACKAGE_VERSION "10beta2"
  
  /* Define to the name of a signed 128-bit integer type. */
  #undef PG_INT128_TYPE
Simple merge
index 00d33ea21ebff6fa4ea91721ab84ca812535e2ad,5fe999e30826fd79641e7a564ee4ecd9ba6ae222..ac204c9eca5c8d6005327c1cc044ffeab7295e47
@@@ -107,35 -107,39 +107,39 @@@ INSERT INTO domarrtest values ('{2,2}'
  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;
+ INSERT INTO domarrtest (testint4arr[1], testint4arr[3]) values (11,22);
 +select * from domarrtest order by 1, 2;
    testint4arr  |    testchar4arr     
  ---------------+---------------------
   {2,2}         | {{a,b},{c,d}}
 - {{2,2},{2,2}} | {{a,b}}
   {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)
+  {11,NULL,22}  | 
+ (6 rows)
  
 -select testint4arr[1], testchar4arr[2:2] from domarrtest;
 +select testint4arr[1], testchar4arr[2:2] from domarrtest order by 1, 2;
   testint4arr | testchar4arr 
  -------------+--------------
 +           2 | {{c}}
             2 | {{c,d}}
 -             | {}
             2 | {{c,d}}
 -           2 | {{c}}
 +             | {}
               | {{d,e,f}}
- (5 rows)
+           11 | 
+ (6 rows)
  
 -select array_dims(testint4arr), array_dims(testchar4arr) from domarrtest;
 +select array_dims(testint4arr), array_dims(testchar4arr) from domarrtest order by 1, 2;
   array_dims | array_dims 
  ------------+------------
 + [1:2]      | [1:2][1:1]
   [1:2]      | [1:2][1:2]
 - [1:2][1:2] | [1:1][1:2]
   [1:2]      | [1:3][1:2]
 - [1:2]      | [1:2][1:1]
 + [1:2][1:2] | [1:1][1:2]
              | [1:2][1:3]
- (5 rows)
+  [1:3]      | 
+ (6 rows)
  
  COPY domarrtest FROM stdin;
  COPY domarrtest FROM stdin;   -- fail
@@@ -145,13 -149,25 +149,25 @@@ select * from domarrtest order by 1, 2
    testint4arr  |    testchar4arr     
  ---------------+---------------------
   {2,2}         | {{a,b},{c,d}}
 - {{2,2},{2,2}} | {{a,b}}
   {2,2}         | {{a,b},{c,d},{e,f}}
   {2,2}         | {{a},{c}}
 -               | {{a,b,c},{d,e,f}}
 - {11,NULL,22}  | 
 + {{2,2},{2,2}} | {{a,b}}
   {3,4}         | {q,w,e}
++ {11,NULL,22}  | 
 +               | {{a,b,c},{d,e,f}}
                 | 
- (7 rows)
+ (8 rows)
+ update domarrtest set
+   testint4arr[1] = testint4arr[1] + 1,
+   testint4arr[3] = testint4arr[3] - 1
+ where testchar4arr is null;
+ select * from domarrtest where testchar4arr is null;
+    testint4arr    | testchar4arr 
+ ------------------+--------------
+  {12,NULL,21}     | 
+  {NULL,NULL,NULL} | 
+ (2 rows)
  
  drop table domarrtest;
  drop domain domainint4arr restrict;
Simple merge
index b81b5ba0a12d8165c23dd4489bdf4c9ee7534b71,5ec128dd254d678d623e3686586257c493af1bec..01d447c342623fd341a9e7cfacb19e284347a0dd
@@@ -85,9 -85,10 +85,10 @@@ INSERT INTO domarrtest values ('{2,2}'
  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"}}');
 -select * from domarrtest;
 -select testint4arr[1], testchar4arr[2:2] from domarrtest;
 -select array_dims(testint4arr), array_dims(testchar4arr) from domarrtest;
+ INSERT INTO domarrtest (testint4arr[1], testint4arr[3]) values (11,22);
 +select * from domarrtest order by 1, 2;
 +select testint4arr[1], testchar4arr[2:2] from domarrtest order by 1, 2;
 +select array_dims(testint4arr), array_dims(testchar4arr) from domarrtest order by 1, 2;
  
  COPY domarrtest FROM stdin;
  {3,4} {q,w,e}
@@@ -98,8 -99,15 +99,15 @@@ COPY domarrtest FROM stdin; -- fai
  {3,4} {qwerty,w,e}
  \.
  
 -select * from domarrtest;
 +select * from domarrtest order by 1, 2;
  
+ update domarrtest set
+   testint4arr[1] = testint4arr[1] + 1,
+   testint4arr[3] = testint4arr[3] - 1
+ where testchar4arr is null;
+ select * from domarrtest where testchar4arr is null;
  drop table domarrtest;
  drop domain domainint4arr restrict;
  drop domain domainchar4arr restrict;
Simple merge
Simple merge