Commits : Individual Commit

  Analyzed 4 days ago based on code collected 4 days ago.

Commit ID 9dbf2b7d75de5af38d087cbe2b1147dd0fd10f0a

Anon80 Contributor: Tom Lane Files Modified: 47
Date: 20-March-2012 at 01:37 Lines Added: 909
Repository: git://git.postgresql.org/git/postgresql.git master Lines Removed: 679
Commit Comment: Restructure SELECT INTO's parsetree representation into CreateTableAsStmt.
Making this operation look like a utility statement seems generally a good
idea, and particularly so in light of the desire to provide command
triggers for utility statements. The original choice of representing it as
SELECT with an IntoClause appendage had metastasized into rather a lot of
places, unfortunately, so that this patch is a great deal more complicated
than one might at first expect.

In particular, keeping EXPLAIN working for SELECT INTO and CREATE TABLE AS
subcommands required restructuring some EXPLAIN-related APIs. Add-on code
that calls ExplainOnePlan or ExplainOneUtility, or uses
ExplainOneQuery_hook, will need adjustment.

Also, the cases PREPARE ... SELECT INTO and CREATE RULE ... SELECT INTO,
which formerly were accepted though undocumented, are no longer accepted.
The PREPARE case can be replaced with use of CREATE TABLE AS EXECUTE.
The CREATE RULE case doesn't seem to have much real-world use (since the
rule would work only once before failing with "table already exists"),
so we'll not bother with that one.

Both SELECT INTO and CREATE TABLE AS still return a command tag of
"SELECT nnnn". There was some discussion of returning "CREATE TABLE nnnn",
but for the moment backwards compatibility wins the day.

Andres Freund and Tom Lane
 

Changes by Language

Language Code Added Code Removed Comments Added Comment Removed Blanks Added Blanks Removed
  C 487 426 296 182 96 64
  C++ 8 5 12 1 0 0
  SQL 5 0 3 0 1 0
  Make 1 1 0 0 0 0

Changes by File

Showing page 1 of 5
File Language Code Added Code Removed Comments Added Comment Removed Blanks Added Blanks Removed
src/backend/commands/copy.c C 4 3 1 1 1 0
src/backend/commands/createas.c C 220 0 146 0 57 0
src/backend/commands/explain.c C 36 12 19 2 4 0
src/backend/commands/Makefile Make 1 1 0 0 0 0
src/backend/commands/portalcmds.c C 1 1 0 0 0 0
src/backend/commands/prepare.c C 20 32 25 12 0 5
src/backend/commands/view.c C 6 3 1 0 0 0
src/backend/executor/execMain.c C 8 227 6 137 0 56
src/backend/executor/execUtils.c C 0 2 0 0 0 0
src/backend/executor/functions.c C 1 3 0 0 0 0
 
 
 

Creative Commons License Copyright © 2013 Black Duck Software, Inc. and its contributors, Some Rights Reserved. Unless otherwise marked, this work is licensed under a Creative Commons Attribution 3.0 Unported License . Ohloh ® and the Ohloh logo are trademarks of Black Duck Software, Inc. in the United States and/or other jurisdictions. All other trademarks are the property of their respective holders.