[Bug Fix] ECPG: could not use some CREATE TABLE AS syntax

Поиск
Список
Период
Сортировка
От Higuchi, Daisuke
Тема [Bug Fix] ECPG: could not use some CREATE TABLE AS syntax
Дата
Msg-id 1803D792815FC24D871C00D17AE95905DB29DB@g01jpexmbkw24
обсуждение исходный текст
Ответы Re: [Bug Fix] ECPG: could not use some CREATE TABLE AS syntax  (Michael Meskes <meskes@postgresql.org>)
Список pgsql-hackers
Hi, 

I found some "CREATE TABLE ... AS ... " syntaxes could not be used in ECPG. 

[PROBLEM]
First, ECPG command is failed when the source code (*.pgc) has "IF NOT EXISTS". 
-------------------------------------------------------------------
EXEC SQL CREATE TABLE IF NOT EXISTS test_cta AS SELECT * FROM test;
-------------------------------------------------------------------

Second, ECPG command is succeeded when the source code (*.pgc) has following embedded SQL. However, created c program
hasno "WITH NO DATA". 
 
------------------------------------------------------------------
EXEC SQL CREATE TABLE test_cta AS SELECT * FROM test WITH NO DATA;
------------------------------------------------------------------

[Investigation]
In my investigation, parse.pl ignore type CreateAsStmt of gram.y and CreateAsStmt is defined in ecpg.trailer. ECPG use
ecpg.trailer'sCreateAsStmt. However, ecpg.trailer lacks some syntaxes. 
 
I feel ignoring type CreateAsStmt of gram.y is strange. Seeing ecpg.trailer, it seems that ECPG wanted to output the
message"CREATE TABLE AS cannot specify INTO" but is this needed now? In view of the maintenance, ECPG should use not
ecpg.trailer'sdefinition but gram.y's one. 
 

I attached the patch for this and I will register this for next CF. 

Regards, 
Daisuke Higuchi


Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Haribabu Kommi
Дата:
Сообщение: Re: pg_basebackup ignores the existing data directory permissions
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Prevent extension creation in temporary schemas