forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit9dbf2b7
committed
Restructure SELECT INTO's parsetree representation into CreateTableAsStmt.
Making this operation look like a utility statement seems generally a goodidea, and particularly so in light of the desire to provide commandtriggers for utility statements. The original choice of representing it asSELECT with an IntoClause appendage had metastasized into rather a lot ofplaces, unfortunately, so that this patch is a great deal more complicatedthan one might at first expect.In particular, keeping EXPLAIN working for SELECT INTO and CREATE TABLE ASsubcommands required restructuring some EXPLAIN-related APIs. Add-on codethat calls ExplainOnePlan or ExplainOneUtility, or usesExplainOneQuery_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 therule 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 Lane1 parent77503a7 commit9dbf2b7
File tree
47 files changed
+963
-729
lines changed- src
- backend
- commands
- executor
- nodes
- optimizer
- plan
- prep
- util
- parser
- rewrite
- tcop
- utils/cache
- include
- catalog
- commands
- executor
- nodes
- parser
- tcop
- pl/plpgsql/src
- test/regress
- expected
- sql
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
47 files changed
+963
-729
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
16 |
| - | |
| 16 | + | |
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
|
Lines changed: 6 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1210 | 1210 |
| |
1211 | 1211 |
| |
1212 | 1212 |
| |
1213 |
| - | |
1214 |
| - | |
1215 | 1213 |
| |
1216 |
| - | |
1217 |
| - | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
1218 | 1217 |
| |
1219 | 1218 |
| |
1220 | 1219 |
| |
1221 | 1220 |
| |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
1222 | 1224 |
| |
1223 | 1225 |
| |
1224 | 1226 |
| |
|
0 commit comments
Comments
(0)