Is anyone using PostGreSql?

Xbase++ 2.0 Build 554 or later
Post Reply
Message
Author
User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Is anyone using PostGreSql?

#1 Post by rdonnay »

I can’t find any documentation on how to get Data Dictionary information from PostGreSql.
The below statement works in PgAdmin but not in Xbase++.

I tried the SELECT command and the USE command to no avail.

SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = 'public'

I am not having problems accessing data from Northwind and also other databases that I have upsized, so I know that I am communicating with the server.
The eXpress train is coming - and it has more cars.

User avatar
Auge_Ohr
Posts: 1405
Joined: Wed Feb 24, 2010 3:44 pm

Re: Is anyone using PostGreSql?

#2 Post by Auge_Ohr »

hi,
rdonnay wrote:

Code: Select all

SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = 'public'
try this way

Code: Select all

   ::cQuery := "SELECT table_name FROM information_schema.tables " + ;
                     "WHERE table_schema = 'public'"
greetings by OHR
Jimmy

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Is anyone using PostGreSql?

#3 Post by rdonnay »

That doesn't work either.

What is ::cQuery ?

What command or function do you run after creating the statement?

It appears that the only way that Postgresql is useful is via the ODBCDBE.
The eXpress train is coming - and it has more cars.

User avatar
Auge_Ohr
Posts: 1405
Joined: Wed Feb 24, 2010 3:44 pm

Re: Is anyone using PostGreSql?

#4 Post by Auge_Ohr »

hi,

i'm using PostgreSQL native this Way.

Code: Select all

         // send Query
         //
         IF ::oPG:Exec( ::cQuery )
            ::oR_Table := ::oPG:result
merry Xmas :occasion-xmas:
greetings by OHR
Jimmy

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Is anyone using PostGreSql?

#5 Post by rdonnay »

What class is ::oPG ?

What do you mean by native?

Are you using a 3rd party library?
The eXpress train is coming - and it has more cars.

User avatar
Auge_Ohr
Posts: 1405
Joined: Wed Feb 24, 2010 3:44 pm

Re: Is anyone using PostGreSql?

#6 Post by Auge_Ohr »

hi,

i just use libpq.dll*** (32bit) native to access PostgreSQL. it is based on Phil Ide CLASS from 2003.
xbpgsql.zip
Original Version from Phil Ide
(38.57 KiB) Downloaded 816 times
as i use ot4xb i use Xbase++ Wrapper from Pablo Botella.
libpq4xb.zip
ot4xb Version
(3.6 KiB) Downloaded 804 times
have fun

*** Note : libpq.dll itself need some *.DLL
copy all *.DLL (except wxbase28u*.DLL) from \PostgreSQL\xx.x\bin\ into your Xbase++ App Directory
greetings by OHR
Jimmy

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Is anyone using PostGreSql?

#7 Post by rdonnay »

I found a solution. I discovered DacSqlStatement().

Code: Select all

IF(!DbeLoad("pgdbe"))
  Alert( "Unable to load the PostgreSQL DatabaseEngine", {"Quit"} )
  QUIT
ENDIF

// Establish the connection
cConnect := "DBE=pgdbe;SERVER=localhost;DB=northwind;UID=postgres;PWD=" + GetEnv('POSTGRESQL_PASSWORD')

oSession := DacSession():New( cConnect ):GetDefault()

IF .NOT. oSession:isConnected()
  DCMSGBOX oSession:GetLastMessage(), ;
           "Unable to establish connection to server"
  QUIT
ENDIF

cSql := "SELECT * FROM INFORMATION_SCHEMA.COLUMNS" + ;
        " WHERE table_schema = 'public'"  + ;
        " ORDER BY table_name,column_name"

oStmt := DacSqlStatement():FromChar(cSql)

oStmt:Build():Query(,'TABLES')

DC_Dot()
The eXpress train is coming - and it has more cars.

User avatar
unixkd
Posts: 565
Joined: Thu Feb 11, 2010 1:39 pm

Re: Is anyone using PostGreSql?

#8 Post by unixkd »

Hi Roger

How about the performance of pgdbe from your current interraction ?

Thanks

Joe

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Is anyone using PostGreSql?

#9 Post by rdonnay »

How about the performance of pgdbe
I don't use it in ISAM mode because it still doesn't work.

If I open a table with dbUsearea() it doesn't navigate correctly.
But if I open the same table with SELECT * it works fine.

Performance seems pretty good in SQL mode.
The eXpress train is coming - and it has more cars.

Post Reply