Re: Add missing CREATE TABLE IF NOT EXISTS table_name AS EXECUTE query;

2019-03-10 Thread Michael Paquier
On Sun, Mar 10, 2019 at 06:56:57PM +0530, Ramanarayana wrote: > Will it be helpful if the comments section of ExecuteStmt in gram.y is > updated to include the IF NOT EXISTS clause.Something like this > > CREATE TABLE [IF NOT EXISTS] AS EXECUTE [(params, ...)] Not sure it helps much. The other

Re: Add missing CREATE TABLE IF NOT EXISTS table_name AS EXECUTE query;

2019-03-10 Thread Ramanarayana
Hi, Will it be helpful if the comments section of ExecuteStmt in gram.y is updated to include the IF NOT EXISTS clause.Something like this CREATE TABLE [IF NOT EXISTS] AS EXECUTE [(params, ...)] Regards, Ram.

Re: Add missing CREATE TABLE IF NOT EXISTS table_name AS EXECUTE query;

2019-02-17 Thread Michael Paquier
On Sun, Feb 17, 2019 at 03:31:05PM +0100, Andreas Karlsson wrote: > Yeah, noticed the same thing myself while refactoring the CTAS code, but I > guess the output could be like the current output for "EXPLAIN ANALYZE > WITH NO DATA;", i.e. a top plan with "(never executed)" (see below > for an exam

Re: Add missing CREATE TABLE IF NOT EXISTS table_name AS EXECUTE query;

2019-02-17 Thread Andreas Karlsson
On 15/02/2019 09.14, Michael Paquier wrote: On Mon, Feb 11, 2019 at 09:53:59PM +0900, Michael Paquier wrote: Let's wait a bit more than the beginning of this week. I forgot about this week's minor release, and it is too late to do something about this report now, so we will have to wait unt OK

Re: Add missing CREATE TABLE IF NOT EXISTS table_name AS EXECUTE query;

2019-02-15 Thread Michael Paquier
On Mon, Feb 11, 2019 at 09:53:59PM +0900, Michael Paquier wrote: > Let's wait a bit more than the beginning of this week. I forgot about > this week's minor release, and it is too late to do something about > this report now, so we will have to wait until the release had > happened. OK, committed

Re: Add missing CREATE TABLE IF NOT EXISTS table_name AS EXECUTE query;

2019-02-11 Thread Michael Paquier
On Thu, Feb 07, 2019 at 10:31:35AM +0900, Michael Paquier wrote: > I'd like to get that addressed before working on the other item > reshuffling the CTAS relation creation. Let's wait for a couple of > days and see if folks have objections, and then revisit it at the > beginning of next week. CTA

Re: Add missing CREATE TABLE IF NOT EXISTS table_name AS EXECUTE query;

2019-02-06 Thread Michael Paquier
On Wed, Feb 06, 2019 at 04:23:44PM +0100, Andreas Karlsson wrote: > I added a test in create_table.sql where the test for the other form of CTAS > IF NOT EXISTS is. Okay, we can live with that. Instead of a scan on pg_class, I would have switched to a more simple thing like that for the PREPARE q

Re: Add missing CREATE TABLE IF NOT EXISTS table_name AS EXECUTE query;

2019-02-06 Thread Andreas Karlsson
On 2/6/19 12:49 PM, Michael Paquier wrote: A test case in select_into.sql would be nice. Should we back-patch that? It seems to me that this qualifies as a bug fix, and I don't see a reason to not support it knowing that we have the infrastructure for that. I added a test in create_table.sql

Re: Add missing CREATE TABLE IF NOT EXISTS table_name AS EXECUTE query;

2019-02-06 Thread Michael Paquier
On Wed, Feb 06, 2019 at 03:20:41AM +0100, Andreas Karlsson wrote: > The first example below works while the second one is a syntax error despite > that the documentation > (https://www.postgresql.org/docs/11/sql-createtableas.html) makes it seem > like both should be valid. I do not see any reason

Add missing CREATE TABLE IF NOT EXISTS table_name AS EXECUTE query;

2019-02-05 Thread Andreas Karlsson
Hi, The first example below works while the second one is a syntax error despite that the documentation (https://www.postgresql.org/docs/11/sql-createtableas.html) makes it seem like both should be valid. I do not see any reason to not support CTAS with both IF NOT EXISTS and EXECUTE at the s