hawq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GodenYao <...@git.apache.org>
Subject [GitHub] incubator-hawq pull request: HAWQ-628. Return -1 instead of error.
Date Tue, 12 Apr 2016 21:02:16 GMT
Github user GodenYao commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/595#discussion_r59453051
  
    --- Diff: src/backend/utils/adt/dbsize.c ---
    @@ -180,9 +180,7 @@ calculate_database_size(Oid dbOid)
     	Assert(Gp_role != GP_ROLE_EXECUTE);
     
     	if (dbOid == HcatalogDbOid)
    -		ereport(ERROR,
    -			(ERRCODE_UNDEFINED_DATABASE,
    -			errmsg("database hcatalog (OID 6120) is reserved")));
    +		return -1;
    --- End diff --
    
    This is to solve incompatibility with psql clients (not hawq client). In hawq client,
we hide hcatalog from being displayed in \l or \l+. But with other psql clients, if we error
out in dbsize, \l and \l+ will also error out and show nothing.
    
    A compromise solution, which we implemented here is to return hcatalog dbsize as -1. Based
on my investigation and interview with some users they think -1 is better than 0, as it's
not a valid size info, so users who may rely on this value can adjust their logic to exclude
hcatalog as necessary.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message