ECPG: "EXEC SQL CREATE SCHEMA foo" Broken

From: Lee Kindness <lkindness(at)csl(dot)co(dot)uk>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Lee Kindness <lkindness(at)csl(dot)co(dot)uk>, Michael Meskes <meskes(at)postgresql(dot)org>
Subject: ECPG: "EXEC SQL CREATE SCHEMA foo" Broken
Date: 2003-11-19 11:02:59
Message-ID: 16315.19939.40112.428230@kelvin.csl.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

Attachment Content-Type Size
unknown_filename text/plain 1.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Sailesh Krishnamurthy 2003-11-19 11:17:56 Re: Is there going to be a port to Solaris 9 x86 in the
Previous Message strk 2003-11-19 10:44:16 PG7.4 ordering operator