vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Brendan Jurd escribió: > Here's my attempt to remove the typename field from A_Const. There > were a few places (notably flatten_set_variable_args() in guc.c, and > typenameTypeMod() in parse_type.c) where the code expected to see an > A_Const with a typename, and I had to adjust for an A_Const within a > TypeCast. Nonetheless, there was an overall net reduction of 34 lines > of code, so I think this was a win. Do say ... why don't we do away with A_Const altogether and just replace it with Value? After this patch, I don't see what's the difference. -- Alvaro Herrera http://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support -- Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-patches |
| |||
| Alvaro Herrera <alvherre@commandprompt.com> writes: > Brendan Jurd escribió: >> Here's my attempt to remove the typename field from A_Const. There >> were a few places (notably flatten_set_variable_args() in guc.c, and >> typenameTypeMod() in parse_type.c) where the code expected to see an >> A_Const with a typename, and I had to adjust for an A_Const within a >> TypeCast. Nonetheless, there was an overall net reduction of 34 lines >> of code, so I think this was a win. > Do say ... why don't we do away with A_Const altogether and just replace > it with Value? After this patch, I don't see what's the difference. They're logically different things, and after I get done putting a parse location field into A_Const, they'll still be physically different too. regards, tom lane -- Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-patches |
| |||
| Tom Lane escribió: > Alvaro Herrera <alvherre@commandprompt.com> writes: > > Brendan Jurd escribió: > >> Here's my attempt to remove the typename field from A_Const. There > >> were a few places (notably flatten_set_variable_args() in guc.c, and > >> typenameTypeMod() in parse_type.c) where the code expected to see an > >> A_Const with a typename, and I had to adjust for an A_Const within a > >> TypeCast. Nonetheless, there was an overall net reduction of 34 lines > >> of code, so I think this was a win. > > > Do say ... why don't we do away with A_Const altogether and just replace > > it with Value? After this patch, I don't see what's the difference. > > They're logically different things, and after I get done putting a parse > location field into A_Const, they'll still be physically different too. Aha. Are you working from Brendan's patch? I was going to commit it. -- Alvaro Herrera http://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support -- Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-patches |
| |||
| Alvaro Herrera <alvherre@commandprompt.com> writes: > Tom Lane escribió: >> They're logically different things, and after I get done putting a parse >> location field into A_Const, they'll still be physically different too. > Aha. Are you working from Brendan's patch? I was going to commit it. Sure, go ahead. I was going to add the parse location at the same time, but it can perfectly well be done as a separate patch. regards, tom lane -- Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-patches |
| |||
| Tom Lane escribió: > Alvaro Herrera <alvherre@commandprompt.com> writes: > > Tom Lane escribió: > >> They're logically different things, and after I get done putting a parse > >> location field into A_Const, they'll still be physically different too. > > > Aha. Are you working from Brendan's patch? I was going to commit it. > > Sure, go ahead. I was going to add the parse location at the same time, > but it can perfectly well be done as a separate patch. I came up with the attached patch. I added the location bits (although I am unsure if I got the locations right in the parser), but they are unused -- figuring out how to use them would take me longer than I can to spend on this. -- Alvaro Herrera http://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support -- Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-patches |
| |||
| Alvaro Herrera escribió: > Tom Lane escribió: > > Alvaro Herrera <alvherre@commandprompt.com> writes: > > > Tom Lane escribió: > > >> They're logically different things, and after I get done putting a parse > > >> location field into A_Const, they'll still be physically different too. > > > > > Aha. Are you working from Brendan's patch? I was going to commit it. > > > > Sure, go ahead. I was going to add the parse location at the same time, > > but it can perfectly well be done as a separate patch. > > I came up with the attached patch. I added the location bits (although > I am unsure if I got the locations right in the parser), but they are > unused -- figuring out how to use them would take me longer than I can > to spend on this. Hmm, I'm now wondering if the location should be added to Value as well, so that it can be passed down to Const? -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc. -- Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-patches |
| |||
| Alvaro Herrera <alvherre@commandprompt.com> writes: > I came up with the attached patch. I wasn't envisioning anything anywhere near this invasive. We only need locations on constants in a few contexts, I think. BTW, you broke _equalAConst() ... it was a bad idea anyway to recast it on the assumption that there would never again be more than one field. regards, tom lane -- Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-patches |
| |||
| Tom Lane escribió: > Alvaro Herrera <alvherre@commandprompt.com> writes: > > I came up with the attached patch. > > I wasn't envisioning anything anywhere near this invasive. We only > need locations on constants in a few contexts, I think. Aha. OK, I'll commit the original patch and let you deal with the rest of it :-) > BTW, you broke _equalAConst() ... it was a bad idea anyway to recast > it on the assumption that there would never again be more than one > field. Oops, sorry, I had intended to revert that part and forgot. -- Alvaro Herrera http://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support -- Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-patches |
| ||||
| Alvaro Herrera <alvherre@commandprompt.com> writes: > Hmm, I'm now wondering if the location should be added to Value as well, > so that it can be passed down to Const? Just for the record, we don't want it in Const. Parse locations are only useful in the "raw grammar" output, mainly because they aren't helpful unless you still have the original query string laying about. regards, tom lane -- Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-patches |
| Thread Tools | |
| Display Modes | |
| |