We are using Appeon PB 2017 R3. We would like to connect to PostgreSQL. In our application specific ini file currently we are using DBMS O10. What is the equivalent one for PostgreSQL?
- You are here:
- Home
- Q&A
- Q&A
- PowerBuilder
- PowerBuilder Integration with PostgreSQL
- Suneetha Velivelli
- PowerBuilder
- Monday, 27 September 2021 22:07 PM UTC
- Tuesday, 28 September 2021 23:22 PM UTC
- PowerBuilder
- # 1
Here's the script DB2SYSPB.SQL, since I cannot attach a TXT file.
//
// This is the script to create the Powerbuilder system tables.
//
// Be sure to:
// - change all occurrences of 'PBOwner' to the name that will own
// the Powerbuilder system tables
// - change all occurrences of 'database.tablespace' to the
// appropriate value
// - put in appropriate statement delimiters for the tool you use
// to execute the sql (i.e. GO statement for ISQL)
// - strip comments and blank lines if necessary
CREATE TABLE PBOwner.PBCATTBL
( PBT_TNAM CHAR(30),
PBT_TID INTEGER,
PBT_OWNR CHAR(30),
PBD_FHGT SMALLINT,
PBD_FWGT SMALLINT,
PBD_FITL CHAR(1),
PBD_FUNL CHAR(1),
PBD_FCHR SMALLINT,
PBD_FPTC SMALLINT,
PBD_FFCE CHAR(18),
PBH_FHGT SMALLINT,
PBH_FWGT SMALLINT,
PBH_FITL CHAR(1),
PBH_FUNL CHAR(1),
PBH_FCHR SMALLINT,
PBH_FPTC SMALLINT,
PBH_FFCE CHAR(18),
PBL_FHGT SMALLINT,
PBL_FWGT SMALLINT,
PBL_FITL CHAR(1),
PBL_FUNL CHAR(1),
PBL_FCHR SMALLINT,
PBL_FPTC SMALLINT,
PBL_FFCE CHAR(18),
PBT_CMNT CHAR(254))
IN database.tablespace
CREATE UNIQUE INDEX PBCATTBL_IDX
ON PBOwner.PBCATTBL
(PBT_TNAM,
PBT_OWNR)
GRANT SELECT, UPDATE, INSERT, DELETE ON
PBOwner.PBCATTBL TO PUBLIC
CREATE TABLE PBOwner.PBCATCOL
( PBC_TNAM CHAR(30),
PBC_TID INTEGER,
PBC_OWNR CHAR(30),
PBC_CNAM CHAR(30),
PBC_CID SMALLINT,
PBC_LABL CHAR(254),
PBC_LPOS SMALLINT,
PBC_HDR CHAR(254),
PBC_HPOS SMALLINT,
PBC_JTFY SMALLINT,
PBC_MASK CHAR(31),
PBC_CASE SMALLINT,
PBC_HGHT SMALLINT,
PBC_WDTH SMALLINT,
PBC_PTRN CHAR(31),
PBC_BMAP CHAR(1),
PBC_INIT CHAR(254),
PBC_CMNT CHAR(254),
PBC_EDIT CHAR(31),
PBC_TAG CHAR(254))
IN database.tablespace
CREATE UNIQUE INDEX PBCATCOL_IDX
ON PBOwner.PBCATCOL
(PBC_TNAM,
PBC_OWNR,
PBC_CNAM)
GRANT SELECT, UPDATE, INSERT, DELETE ON
PBOwner.PBCATCOL TO PUBLIC
CREATE TABLE PBOwner.PBCATFMT
( PBF_NAME CHAR(30) NOT NULL,
PBF_FRMT CHAR(254) NOT NULL,
PBF_TYPE SMALLINT NOT NULL,
PBF_CNTR INTEGER)
IN database.tablespace
CREATE UNIQUE INDEX PBCATFMT_IDX
ON PBOwner.PBCATFMT
(PBF_NAME)
GRANT SELECT, UPDATE, INSERT, DELETE ON
PBOwner.PBCATFMT TO PUBLIC
CREATE TABLE PBOwner.PBCATVLD
( PBV_NAME CHAR(30) NOT NULL,
PBV_VALD CHAR(254) NOT NULL,
PBV_TYPE SMALLINT,
PBV_CNTR INTEGER,
PBV_MSG CHAR(254))
IN database.tablespace
CREATE UNIQUE INDEX PBCATVLD_IDX
ON PBOwner.PBCATVLD
(PBV_NAME)
GRANT SELECT, UPDATE, INSERT, DELETE ON
PBOwner.PBCATVLD TO PUBLIC
CREATE TABLE PBOwner.PBCATEDT
(PBE_NAME CHAR(30) NOT NULL,
PBE_EDIT VARCHAR(254),
PBE_TYPE SMALLINT,
PBE_CNTR INTEGER,
PBE_SEQN SMALLINT,
PBE_FLAG INTEGER,
PBE_WORK CHAR(32))
IN database.tablespace
CREATE UNIQUE INDEX PBCATEDT_IDX
ON PBOwner.PBCATEDT
(PBE_NAME,
PBE_SEQN)
GRANT SELECT, UPDATE, INSERT, DELETE ON
PBOwner.PBCATEDT TO PUBLIC
//
// The following fills the Powerbuilder Format table with
// the default values.
//
INSERT INTO PBOwner.PBCATFMT VALUES (
'[General]',
'[General]',
81,
0)
INSERT INTO PBOwner.PBCATFMT VALUES (
'0',
'0',
81,
0)
INSERT INTO PBOwner.PBCATFMT VALUES (
'0.00',
'0.00',
81,
0)
INSERT INTO PBOwner.PBCATFMT VALUES (
'#,##0',
'#,##0',
81,
0)
INSERT INTO PBOwner.PBCATFMT VALUES (
'#,##0.00',
'#,##0.00',
81,
0)
INSERT INTO PBOwner.PBCATFMT VALUES (
'$#,##0;($#,##0)',
'$#,##0;($#,##0)',
81,
0)
INSERT INTO PBOwner.PBCATFMT VALUES (
'$#,##0;[RED]($#,##0)',
'$#,##0;[RED]($#,##0)',
81,
0)
INSERT INTO PBOwner.PBCATFMT VALUES (
'$#,##0.00;($#,##0.00)',
'$#,##0.00;($#,##0.00)',
81,
0)
INSERT INTO PBOwner.PBCATFMT VALUES (
'$#,##0.00;[RED]($#,##0.00)',
'$#,##0.00;[RED]($#,##0.00)',
81,
0)
INSERT INTO PBOwner.PBCATFMT VALUES (
'0%',
'0%',
81,
0)
INSERT INTO PBOwner.PBCATFMT VALUES (
'0.00%',
'0.00%',
81,
0)
INSERT INTO PBOwner.PBCATFMT VALUES (
'0.00E+00',
'0.00E+00',
81,
0)
INSERT INTO PBOwner.PBCATFMT VALUES (
'm/d/yy',
'm/d/yy',
84,
0)
INSERT INTO PBOwner.PBCATFMT VALUES (
'd-mmm-yy',
'd-mmm-yy',
84,
0)
INSERT INTO PBOwner.PBCATFMT VALUES (
'd-mmm',
'd-mmm',
84,
0)
INSERT INTO PBOwner.PBCATFMT VALUES (
'mmm-yy',
'mmm-yy',
84,
0)
INSERT INTO PBOwner.PBCATFMT VALUES (
'h:mm AM/PM',
'h:mm AM/PM',
84,
0)
INSERT INTO PBOwner.PBCATFMT VALUES (
'h:mm:ss AM/PM',
'h:mm:ss AM/PM',
84,
0)
INSERT INTO PBOwner.PBCATFMT VALUES (
'h:mm:ss',
'h:mm:ss',
84,
0)
INSERT INTO PBOwner.PBCATFMT VALUES (
'm/d/yy h:mm',
'm/d/yy h:mm',
84,
0)
//
// The following fills the Powerbuilder Edit Style table with
// the default values.
//
INSERT INTO PBOwner.PBCATEDT VALUES (
'###,###.00',
'###,###.00',
90,
1,
1,
32,
'10')
INSERT INTO PBOwner.PBCATEDT VALUES (
'#####',
'#####',
90,
1,
1,
32,
'10')
INSERT INTO PBOwner.PBCATEDT VALUES (
'###-##-####',
'###-##-####',
90,
1,
1,
32,
'00')
INSERT INTO PBOwner.PBCATEDT VALUES (
'MM/DD/YY',
'MM/DD/YY',
90,
1,
1,
32,
'20')
INSERT INTO PBOwner.PBCATEDT VALUES (
'DD/MM/YY',
'DD/MM/YY',
90,
1,
1,
32,
'20')
INSERT INTO PBOwner.PBCATEDT VALUES (
'MM/DD/YYYY',
'MM/DD/YYYY',
90,
1,
1,
32,
'20')
INSERT INTO PBOwner.PBCATEDT VALUES (
'DD/MM/YYYY',
'DD/MM/YYYY',
90,
1,
1,
32,
'20')
INSERT INTO PBOwner.PBCATEDT VALUES (
'DD/MMM/YY',
'DD/MMM/YY',
90,
1,
1,
32,
'20')
INSERT INTO PBOwner.PBCATEDT VALUES (
'DDD/YY',
'DDD/YY',
90,
1,
1,
32,
'20')
INSERT INTO PBOwner.PBCATEDT VALUES (
'DDD/YYYY',
'DDD/YYYY',
90,
1,
1,
32,
'20')
INSERT INTO PBOwner.PBCATEDT VALUES (
'HH:MM:SS',
'HH:MM:SS',
90,
1,
1,
32,
'30')
INSERT INTO PBOwner.PBCATEDT VALUES (
'HH:MM:SS:FFF',
'HH:MM:SS:FFF',
90,
1,
1,
32,
'30')
INSERT INTO PBOwner.PBCATEDT VALUES (
'HH:MM:SS:FFFFFF',
'HH:MM:SS:FFFFFF',
90,
1,
1,
32,
'30')
INSERT INTO PBOwner.PBCATEDT VALUES (
'MM/DD/YY HH:MM:SS',
'MM/DD/YY HH:MM:SS',
90,
1,
1,
32,
'40')
INSERT INTO PBOwner.PBCATEDT VALUES (
'DD/MM/YY HH:MM:SS',
'DD/MM/YY HH:MM:SS',
90,
1,
1,
32,
'40')
INSERT INTO PBOwner.PBCATEDT VALUES (
'MM/DD/YYYY HH:MM:SS',
'MM/DD/YYYY HH:MM:SS',
90,
1,
1,
32,
'40')
INSERT INTO PBOwner.PBCATEDT VALUES (
'DD/MM/YYYY HH:MM:SS',
'DD/MM/YYYY HH:MM:SS',
90,
1,
1,
32,
'40')
INSERT INTO PBOwner.PBCATEDT VALUES (
'DD/MMM/YY HH:MM:SS',
'DD/MMM/YY HH:MM:SS',
90,
1,
1,
32,
'40')
INSERT INTO PBOwner.PBCATEDT VALUES (
'DDD/YY HH:MM:SS',
'DDD/YY HH:MM:SS',
90,
1,
1,
32,
'40')
INSERT INTO PBOwner.PBCATEDT VALUES (
'DDD/YYYY HH:MM:SS',
'DDD/YYYY HH:MM:SS',
90,
1,
1,
32,
'40')
INSERT INTO PBOwner.PBCATEDT VALUES (
'DD/MM/YY HH:MM:SS:FFFFFF',
'DD/MM/YY HH:MM:SS:FFFFFF',
90,
1,
1,
32,
'40')
- Tuesday, 28 September 2021 23:21 PM UTC
- PowerBuilder
- # 2
Suneetha -
THis is what I'm using as the PROFILE for my test database:
and this is the DSN:
Notice the user.
and when you click Manage DSN, I have this:
I click TEST:
In PB2019R3:
When I CONNECT through the IDE, I do not get that message. However, I have seen it, but like Chris said once you've logged on as a user with DBA rights, the tables should get created.
Note that I cannot see the catalog tables in the list of tables or the list of views, but when I try "select * from pbcatcol;" I get results.
As a last option, you can always create these tables and populate them from the script DB2SYSPB.SQL provided with the install. NOTE: You DO need to tweak the script for your particular database.
Good Luck,
Olan
- Suneetha Velivelli
- Wednesday, 6 October 2021 21:54 PM UTC
-
Helpful Loading... Helpful 0
- Suneetha Velivelli
- Thursday, 7 October 2021 16:44 PM UTC
-
Helpful Loading... Helpful 0
- Tuesday, 28 September 2021 13:30 PM UTC
- PowerBuilder
- # 3
Hi Suneetha;
FYI .. HTH
- Suneetha Velivelli
- Tuesday, 28 September 2021 21:41 PM UTC
In Appeon 2017 R3 PB, in database profile, I created profile under ODB ODBC with data source as PostgreSQL35W. When tried to test connection from Preview tab, it show Error message "Catalog tables cannot be created and are not available for use". Clicked Ok, and it shows "Connection Successful".
In the ini file, I tried to replace DBMS=O10 Oracle10g (10.1.0) with DBMS=ODB ODBC. Is this correct?
-
Helpful Loading... Helpful 1
- Armeen Mazda @Appeon
- Tuesday, 28 September 2021 21:58 PM UTC
-
Helpful Loading... Helpful 0
- Chris Pollach @Appeon
- Tuesday, 28 September 2021 23:05 PM UTC
The first user that connects to any new DB must connect with DBA (Create Table) privileges so that the IDE can create the 5 PB Catalog tables. Once that is done, any normally privileged user can login without this prompt happening again.
Regards ... Chris
-
Helpful Loading... Helpful 0
- Tuesday, 28 September 2021 01:04 AM UTC
- PowerBuilder
- # 4
Here are a couple of tech articles I wrote about this.
1) https://community.appeon.com/index.php/articles-blogs/tutorials-articles/2-powerbuilder/334-defining-a-postgresql-database-profile-in-pb2019r3
Later -
Olan
- Suneetha Velivelli
- Tuesday, 28 September 2021 21:43 PM UTC
I installed the ODBC driver for PostgreSQL and created ODBC database profile setup for PostgreSQL (system DSN name: PostgreSQL35W; Platform 32bit; Driver: PostgreSQL Unicode). Test connection from ODBC is successful.
In Appeon 2017 R3 PB, in database profile, I created profile under ODB ODBC with data source as PostgreSQL35W. When tried to test connection from Preview tab, it show Error message "Catalog tables cannot be created and are not available for use". Clicked Ok, and it shows "Connection Successful". Not sure why it showed the catalog tables error before showing connection successful. In the ini file, I tried to replace DBMS=O10 Oracle10g (10.1.0) with DBMS=ODB ODBC. Is this correct?
-
Helpful Loading... Helpful 1
- Chris Pollach @Appeon
- Tuesday, 28 September 2021 23:07 PM UTC
-
Helpful Loading... Helpful 0
- Monday, 27 September 2021 22:26 PM UTC
- PowerBuilder
- # 5
Hi Suneetha;
PB's support for PostgreSQL is via the ODBC driver. You can read all about this in the PB help.
Regards ... Chris
- Suneetha Velivelli
- Tuesday, 28 September 2021 21:48 PM UTC
-
Helpful Loading... Helpful 0
- Page :
- 1
However, you are not allowed to reply to this question.
Frankly, I did not care enough to pursue the reason for the fale error msg since everything is actually working correctly! :)
Our version of the PG datyabase is set to LOWERCASE.