[HACKERS] ECPG: EXEC SQL CREATE SCHEMA foo Broken

2003-11-19 Thread Lee Kindness
Hi, please apply patch below to correct the EXEC SQL CREATE SCHEMA
construct in ECPG. Currently (versions 7.3.x, 7.4) the preprocessor
emmits create scheme in error, rather than create schema.

A workaround also exists for those who require it (but I guess no-one
apart from me does since it's went unreported through 7.3), rather
than (checking omitted):

 EXEC SQL CREATE SCHEMA foo;

you can use:

 EXEC SQL BEGIN DECLARE SECTION;
 char l_cmd[50];
 EXEC SQL END DECLARE SECTION;

 snprintf(l_cmd, sizeof(l_cmd), CREATE SCHEMA foo);
 EXEC SQL EXECUTE IMMEDIATE :l_cmd;

Thanks, L.

*** src/interfaces/ecpg/preproc/preproc.y.orig  2003-11-19 10:52:25.0 +
--- src/interfaces/ecpg/preproc/preproc.y   2003-11-19 10:52:30.0 +
***
*** 966,974 
   */
  
  CreateSchemaStmt:  CREATE SCHEMA UserId OptSchemaName AUTHORIZATION UserId 
OptSchemaEltList
!   { $$ = cat_str(6, make_str(create scheme), $3, $4, 
make_str(authorization), $6, $7); }
| CREATE SCHEMA ColId OptSchemaEltList
!   { $$ = cat_str(3, make_str(create scheme), $3, $4); }
;
  
  OptSchemaName: ColId  { $$ = $1; }
--- 966,974 
   */
  
  CreateSchemaStmt:  CREATE SCHEMA UserId OptSchemaName AUTHORIZATION UserId 
OptSchemaEltList
!   { $$ = cat_str(6, make_str(create schema), $3, $4, 
make_str(authorization), $6, $7); }
| CREATE SCHEMA ColId OptSchemaEltList
!   { $$ = cat_str(3, make_str(create schema), $3, $4); }
;
  
  OptSchemaName: ColId  { $$ = $1; }

---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
  joining column's datatypes do not match


Re: [HACKERS] ECPG: EXEC SQL CREATE SCHEMA foo Broken

2003-11-19 Thread Michael Meskes
On Wed, Nov 19, 2003 at 11:02:59AM +, Lee Kindness wrote:
 Hi, please apply patch below to correct the EXEC SQL CREATE SCHEMA
 construct in ECPG. Currently (versions 7.3.x, 7.4) the preprocessor
 emmits create scheme in error, rather than create schema.

Thanks. Applied to HEAD and 7.4. I take it it will make it into 7.4.1
this way.

Michael
-- 
Michael Meskes
Email: Michael at Fam-Meskes dot De
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: [EMAIL PROTECTED]
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [HACKERS] ECPG: EXEC SQL CREATE SCHEMA foo Broken

2003-11-19 Thread Bruce Momjian
Michael Meskes wrote:
 On Wed, Nov 19, 2003 at 11:02:59AM +, Lee Kindness wrote:
  Hi, please apply patch below to correct the EXEC SQL CREATE SCHEMA
  construct in ECPG. Currently (versions 7.3.x, 7.4) the preprocessor
  emmits create scheme in error, rather than create schema.
 
 Thanks. Applied to HEAD and 7.4. I take it it will make it into 7.4.1
 this way.

Yes.

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faqs/FAQ.html