From f0467b30b74d2af72480bb20867164ef030f3c56 Mon Sep 17 00:00:00 2001
From: amit <amitlangote09@gmail.com>
Date: Thu, 9 Mar 2017 09:51:39 +0900
Subject: [PATCH] Use ALTER FOREIGN TABLE with foreign table in tests

---
 src/test/regress/expected/foreign_data.out | 8 ++++----
 src/test/regress/sql/foreign_data.sql      | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/test/regress/expected/foreign_data.out b/src/test/regress/expected/foreign_data.out
index a0f969f3e5..ea197c5e4f 100644
--- a/src/test/regress/expected/foreign_data.out
+++ b/src/test/regress/expected/foreign_data.out
@@ -1851,11 +1851,11 @@ Server: s0
 FDW Options: (delimiter ',', quote '"', "be quoted" 'value')
 
 -- cannot add column to a partition
-ALTER TABLE pt2_1 ADD c4 char;
+ALTER FOREIGN TABLE pt2_1 ADD c4 char;
 ERROR:  cannot add column to a partition
 -- ok to have a partition's own constraints though
-ALTER TABLE pt2_1 ALTER c3 SET NOT NULL;
-ALTER TABLE pt2_1 ADD CONSTRAINT p21chk CHECK (c2 <> '');
+ALTER FOREIGN TABLE pt2_1 ALTER c3 SET NOT NULL;
+ALTER FOREIGN TABLE pt2_1 ADD CONSTRAINT p21chk CHECK (c2 <> '');
 \d+ pt2
                                     Table "public.pt2"
  Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
@@ -1880,7 +1880,7 @@ Server: s0
 FDW Options: (delimiter ',', quote '"', "be quoted" 'value')
 
 -- cannot drop inherited NOT NULL constraint from a partition
-ALTER TABLE pt2_1 ALTER c1 DROP NOT NULL;
+ALTER FOREIGN TABLE pt2_1 ALTER c1 DROP NOT NULL;
 ERROR:  column "c1" is marked NOT NULL in parent table
 -- partition must have parent's constraints
 ALTER TABLE pt2 DETACH PARTITION pt2_1;
diff --git a/src/test/regress/sql/foreign_data.sql b/src/test/regress/sql/foreign_data.sql
index c13d5ffbe9..8c5fcb8b35 100644
--- a/src/test/regress/sql/foreign_data.sql
+++ b/src/test/regress/sql/foreign_data.sql
@@ -720,16 +720,16 @@ ALTER TABLE pt2 ATTACH PARTITION pt2_1 FOR VALUES IN (1);
 \d+ pt2_1
 
 -- cannot add column to a partition
-ALTER TABLE pt2_1 ADD c4 char;
+ALTER FOREIGN TABLE pt2_1 ADD c4 char;
 
 -- ok to have a partition's own constraints though
-ALTER TABLE pt2_1 ALTER c3 SET NOT NULL;
-ALTER TABLE pt2_1 ADD CONSTRAINT p21chk CHECK (c2 <> '');
+ALTER FOREIGN TABLE pt2_1 ALTER c3 SET NOT NULL;
+ALTER FOREIGN TABLE pt2_1 ADD CONSTRAINT p21chk CHECK (c2 <> '');
 \d+ pt2
 \d+ pt2_1
 
 -- cannot drop inherited NOT NULL constraint from a partition
-ALTER TABLE pt2_1 ALTER c1 DROP NOT NULL;
+ALTER FOREIGN TABLE pt2_1 ALTER c1 DROP NOT NULL;
 
 -- partition must have parent's constraints
 ALTER TABLE pt2 DETACH PARTITION pt2_1;
-- 
2.11.0

