Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "rda_python_common"
version = "1.0.39"
version = "1.0.40"
authors = [
{ name="Zaihua Ji", email="[email protected]" },
]
Expand Down
17 changes: 10 additions & 7 deletions src/rda_python_common/PgDBI.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
DBNAMES = {
'ivaddb' : 'ivaddb',
'cntldb' : 'ivaddb',
'ivaddb1' : 'ivaddb',
'cntldb1' : 'ivaddb',
'cdmsdb' : 'ivaddb',
'ispddb' : 'ispddb',
'obsua' : 'upadb',
Expand Down Expand Up @@ -113,20 +115,21 @@ def SETPGDBI(name, value):
PGDBI['VHSET'] = 0
PGDBI['PGSIZE'] = 1000 # number of records for page_size
PGDBI['MTRANS'] = 5000 # max number of changes in one transactions
PGDBI['MAXICNT'] = 12000000 # maximum number of records in each table
PGDBI['MAXICNT'] = 6000000 # maximum number of records in each table

#
# create a pgddl command string with
# table name (tname), prefix (pre) and suffix (suf)
#
def get_pgddl_command(tname, pre = None, suf = None):
def get_pgddl_command(tname, pre = None, suf = None, scname = None):

ms = re.match(r'^(.+)\.(.+)$', tname)
if ms:
scname = ms.group(1)
tname = ms.group(2)
else:
scname = PGDBI['SCNAME']
if not scname:
if ms:
scname = ms.group(1)
tname = ms.group(2)
else:
scname = PGDBI['SCNAME']
xy = ''
if suf: xy += ' -x ' + suf
if pre: xy += ' -y ' + pre
Expand Down