Re: Fixes gram.y - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Fixes gram.y
Date
Msg-id 200203191251.g2JCpmf14322@candle.pha.pa.us
Whole thread Raw
In response to Fixes gram.y  ("Rod Taylor" <rbt@zort.ca>)
Responses Re: [PATCHES] Fixes gram.y
List pgsql-hackers
Rod Taylor wrote:
> I truely don't know what I did to create the nasty patch (source file
> certainly didn't look like what it resulted in) -- then again there
> have been alot of changes since the domain patch was created.
>
> This should fix gram.y
>
> If anyone knows a better way of creating patches other than diff -rc ,
> please speak up.

I have applied the following new patch.  It moves DROP DATABASE as you
suggested, and fixes the CREATE TABLE tag to show just CREATE and not
CREATE DOMAIN.   Actually, CREATE DOMAIN should output just DOMAIN too,
unless someone can tell my why that is not consistent.  Patch applied to
CVS.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
Index: src/backend/parser/gram.y
===================================================================
RCS file: /cvsroot/pgsql/src/backend/parser/gram.y,v
retrieving revision 2.292
diff -c -r2.292 gram.y
*** src/backend/parser/gram.y    19 Mar 2002 02:18:18 -0000    2.292
--- src/backend/parser/gram.y    19 Mar 2002 12:46:30 -0000
***************
*** 3184,3189 ****
--- 3184,3197 ----
                  {
                      $$ = lconsi(3, makeListi1(-1));
                  }
+         | OWNER opt_equal name
+                 {
+                     $$ = lconsi(4, makeList1($3));
+                 }
+         | OWNER opt_equal DEFAULT
+                 {
+                     $$ = lconsi(4, makeList1(NULL));
+                 }
          ;


***************
*** 3199,3212 ****
                      DropdbStmt *n = makeNode(DropdbStmt);
                      n->dbname = $3;
                      $$ = (Node *)n;
-                 }
-         | OWNER opt_equal name
-                 {
-                     $$ = lconsi(4, makeList1($3));
-                 }
-         | OWNER opt_equal DEFAULT
-                 {
-                     $$ = lconsi(4, makeList1(NULL));
                  }
          ;

--- 3207,3212 ----
Index: src/backend/tcop/postgres.c
===================================================================
RCS file: /cvsroot/pgsql/src/backend/tcop/postgres.c,v
retrieving revision 1.255
diff -c -r1.255 postgres.c
*** src/backend/tcop/postgres.c    19 Mar 2002 02:18:20 -0000    1.255
--- src/backend/tcop/postgres.c    19 Mar 2002 12:46:33 -0000
***************
*** 2213,2220 ****
              break;

          case T_CreateDomainStmt:
          case T_CreateStmt:
!             tag = "CREATE DOMAIN";
              break;

          case T_DropStmt:
--- 2213,2223 ----
              break;

          case T_CreateDomainStmt:
+             tag = "CREATE";            /* CREATE DOMAIN */
+             break;
+
          case T_CreateStmt:
!             tag = "CREATE";
              break;

          case T_DropStmt:

pgsql-hackers by date:

Previous
From: "Rod Taylor"
Date:
Subject: Fixes gram.y
Next
From: Bruce Momjian
Date:
Subject: Re: Fixes gram.y