Re: [HACKERS] ATSimpleRecursion() and inheritance foreign parents

2015-04-30 Thread Etsuro Fujita
On 2015/04/29 4:35, Tom Lane wrote: > Etsuro Fujita writes: >> On 2015/04/28 15:17, Amit Langote wrote: >>> The code at the beginning of ATSimpleRecursion() looks like - >>> if (recurse && rel->rd_rel->relkind == RELKIND_RELATION) >>> Not sure if it's great idea, but now that foreign tables can al

Re: [HACKERS] ATSimpleRecursion() and inheritance foreign parents

2015-04-28 Thread Tom Lane
Etsuro Fujita writes: > On 2015/04/28 15:17, Amit Langote wrote: >> The code at the beginning of ATSimpleRecursion() looks like - >> if (recurse && rel->rd_rel->relkind == RELKIND_RELATION) >> Not sure if it's great idea, but now that foreign tables can also have >> children, should above be chang

Re: [HACKERS] ATSimpleRecursion() and inheritance foreign parents

2015-04-28 Thread David Fetter
On Tue, Apr 28, 2015 at 09:39:02PM +0900, Amit Langote wrote: > On Tue, Apr 28, 2015 at 9:28 PM, David Fetter wrote: > > On Tue, Apr 28, 2015 at 03:17:08PM +0900, Amit Langote wrote: > >> > >> An example, > >> postgres=# alter foreign table fparent alter a type char; > >> ALTER FOREIGN TABLE > >>

Re: [HACKERS] ATSimpleRecursion() and inheritance foreign parents

2015-04-28 Thread Amit Langote
On Tue, Apr 28, 2015 at 9:28 PM, David Fetter wrote: > On Tue, Apr 28, 2015 at 03:17:08PM +0900, Amit Langote wrote: >> >> An example, >> postgres=# alter foreign table fparent alter a type char; >> ALTER FOREIGN TABLE >> >> postgres=# select * from fparent; >> ERROR: attribute "a" of relation "f

Re: [HACKERS] ATSimpleRecursion() and inheritance foreign parents

2015-04-28 Thread David Fetter
On Tue, Apr 28, 2015 at 03:17:08PM +0900, Amit Langote wrote: > > Hi, > > Following ALTER TABLE actions are applied recursively to inheritance > descendents via ATSimpleRecursion() - > > ALTER COLUMN DEFAULT > ALTER COLUMN DROP NOT NULL > ALTER COLUMN SET NOT NULL > ALTER COLUMN SET STATISTICS >

Re: [HACKERS] ATSimpleRecursion() and inheritance foreign parents

2015-04-28 Thread Amit Langote
On Tue, Apr 28, 2015 at 8:45 PM, Etsuro Fujita wrote: > On 2015/04/28 15:17, Amit Langote wrote: > > Yeah, I think we should now allow the recursion for inheritance parents that > are foreign tables as well. Attached is a patch for that. > Thanks! >> An example, >> postgres=# alter foreign tabl

Re: [HACKERS] ATSimpleRecursion() and inheritance foreign parents

2015-04-28 Thread Etsuro Fujita
On 2015/04/28 15:17, Amit Langote wrote: The code at the beginning of ATSimpleRecursion() looks like - /* * Propagate to children if desired. Non-table relations never have * children, so no need to search in that case. */ if (recurse && rel->rd_rel->relkind == RELKIND_RELATION) Not su

[HACKERS] ATSimpleRecursion() and inheritance foreign parents

2015-04-27 Thread Amit Langote
Hi, Following ALTER TABLE actions are applied recursively to inheritance descendents via ATSimpleRecursion() - ALTER COLUMN DEFAULT ALTER COLUMN DROP NOT NULL ALTER COLUMN SET NOT NULL ALTER COLUMN SET STATISTICS ALTER COLUMN SET STORAGE The code at the beginning of ATSimpleRecursion() looks li