mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	Don't try to assign smart names to constraints
This part of my previous commit seems to have broken pg_upgrade on crake, at least from 9.2. I'll see if there's a better fix, but in the meantime this should suffice to keep the buildfarm green.
This commit is contained in:
		@@ -9097,20 +9097,10 @@ getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables)
 | 
				
			|||||||
			else if (use_throwaway_notnull)
 | 
								else if (use_throwaway_notnull)
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
				/*
 | 
									/*
 | 
				
			||||||
				 * Decide on a name for this constraint.  If it is not an
 | 
									 * Give this constraint a throwaway name.
 | 
				
			||||||
				 * inherited constraint, give it a throwaway name to avoid any
 | 
					 | 
				
			||||||
				 * possible conflicts, since we're going to drop it soon
 | 
					 | 
				
			||||||
				 * anyway.  If it is inherited then try harder, because it may
 | 
					 | 
				
			||||||
				 * (but not necessarily) persist after the restore.
 | 
					 | 
				
			||||||
				 */
 | 
									 */
 | 
				
			||||||
				if (tbinfo->notnull_inh[j])
 | 
									tbinfo->notnull_constrs[j] =
 | 
				
			||||||
					/* XXX maybe try harder if the name is overlength */
 | 
										psprintf("pgdump_throwaway_notnull_%d", notnullcount++);
 | 
				
			||||||
					tbinfo->notnull_constrs[j] =
 | 
					 | 
				
			||||||
						psprintf("%s_%s_not_null",
 | 
					 | 
				
			||||||
								 tbinfo->dobj.name, tbinfo->attnames[j]);
 | 
					 | 
				
			||||||
				else
 | 
					 | 
				
			||||||
					tbinfo->notnull_constrs[j] =
 | 
					 | 
				
			||||||
						psprintf("pgdump_throwaway_notnull_%d", notnullcount++);
 | 
					 | 
				
			||||||
				tbinfo->notnull_throwaway[j] = true;
 | 
									tbinfo->notnull_throwaway[j] = true;
 | 
				
			||||||
				tbinfo->notnull_inh[j] = false;
 | 
									tbinfo->notnull_inh[j] = false;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user