mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	Improve two error messages
This commit is contained in:
		@@ -2098,7 +2098,7 @@ transformIndexConstraint(Constraint *constraint, CreateStmtContext *cxt)
 | 
				
			|||||||
					index_rel->rd_indoption[i] != 0)
 | 
										index_rel->rd_indoption[i] != 0)
 | 
				
			||||||
					ereport(ERROR,
 | 
										ereport(ERROR,
 | 
				
			||||||
							(errcode(ERRCODE_WRONG_OBJECT_TYPE),
 | 
												(errcode(ERRCODE_WRONG_OBJECT_TYPE),
 | 
				
			||||||
							 errmsg("index \"%s\" does not have default sorting behavior", index_name),
 | 
												 errmsg("index \"%s\" column number %d does not have default sorting behavior", index_name, i + 1),
 | 
				
			||||||
							 errdetail("Cannot create a primary key or unique constraint using such an index."),
 | 
												 errdetail("Cannot create a primary key or unique constraint using such an index."),
 | 
				
			||||||
							 parser_errposition(cxt->pstate, constraint->location)));
 | 
												 parser_errposition(cxt->pstate, constraint->location)));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -382,8 +382,10 @@ check_new_cluster_is_empty(void)
 | 
				
			|||||||
		{
 | 
							{
 | 
				
			||||||
			/* pg_largeobject and its index should be skipped */
 | 
								/* pg_largeobject and its index should be skipped */
 | 
				
			||||||
			if (strcmp(rel_arr->rels[relnum].nspname, "pg_catalog") != 0)
 | 
								if (strcmp(rel_arr->rels[relnum].nspname, "pg_catalog") != 0)
 | 
				
			||||||
				pg_fatal("New cluster database \"%s\" is not empty\n",
 | 
									pg_fatal("New cluster database \"%s\" is not empty: found relation \"%s.%s\"\n",
 | 
				
			||||||
						 new_cluster.dbarr.dbs[dbnum].db_name);
 | 
											 new_cluster.dbarr.dbs[dbnum].db_name,
 | 
				
			||||||
 | 
											 rel_arr->rels[relnum].nspname,
 | 
				
			||||||
 | 
											 rel_arr->rels[relnum].relname);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user