R: O$ 5.1 Postgres databse logon

George Panagopoulos eyeway1 at otenet.gr
Tue Dec 21 15:52:20 EST 2010


Hi Lou and Franco,

Thanks for your input.
You are both right, the socket thing is not necessary here so I removed it.
My problem is that although I get a connection to the server and I have 
a session object created, as expected, each time I use the table na me 
in a query I have to refer to the database to wich it belongs, wich was 
not the case with MySql.

SELECT * FROM sidebar  Doesn't work but...  SELECT * FROM lynx.sidebar 
works.

Another odd thing I noticed:
When my tables are under the schema called 'public' I can write a query 
like the first one wich works( without referring to the database). I 
still cannot make $select(), $fetch() etc to work.
By the way, what is all this about schemas? Are they in some way affect 
the way the DAM is connected to the database? I happen to find $schema. 
Does this can solve my problem?


TIA

George

Στις 21/12/2010 6:04 μμ, ο/η Lou Picciano έγραψε:
> George,
>
>
> Franco (My Lion of The Cloud) is exactly on target here...
>
>
> I suspect you were using the socket-based connection on a localhost-based MySQL connection. In virtually all cases, a connection using pglib - which is how the Omnis DAM connects - needs only a hostname and port. On any connection except localhost (eg, with 'local' type access in pg_hba.conf), you wouldn't have access to the unix socket anyway... If you want to speed up the connection handshake just a little bit, bypass the name resolver by using the IP address in place of host name (dependent upon your environment; your mileage may vary here...)
>
>
> One quirk of pqlib (or the Omnis DAM) is that it seems to require setting of the port before other properties (which you seem to be doing) - though we haven't bothered to tease out the exact order required. In any case, you seem to be setting the port first - good !
>
>
> Other thing you might check - Windows may have the PG port (default is 5432) closed in a default, firewalled installation. Check your firewall?
>
>
> Enjoy! Lou
>
> ----- Original Message -----
> From: "Franco Maregotto"<franco at hotelaqua.it>
> To: "OmnisDev List - English"<omnisdev-en at lists.omnis-dev.com>
> Sent: Tuesday, December 21, 2010 4:36:55 AM
> Subject: R: O$ 5.1 Postgres databse logon
>
> Do tsk_SessObj.$port.$assign(port)
> Do tsk_SessObj.$database.$assign(DBName)
> Do tsk_SessObj.$hostname.$assign(HostIPaddress)
> Do tsk_SessObj.$logon(HostIPaddress,UserName,Password) Returns #F
> If flag true
> Do tsk_SessObj.$newstatement('SomeSessName_unuseful') Returns tsk_StatemObj
> End If
>
> If you use a local Postgre DB use "localhost" as HostIPAddress
>
> That's what I use and works fine with Postgres DB locally or remote servers
> I might guess that $socket is not the right instruction..
>
> HTH
> Franco
>
> -----Messaggio originale-----
> Da: omnisdev-en-bounces at lists.omnis-dev.com [mailto:omnisdev-en-bounces at lists.omnis-dev.com] Per conto di George Panagopoulos
> Inviato: lunedì 20 dicembre 2010 21.42
> A: OmnisDev List - English
> Oggetto: Re: O$ 5.1 Postgres databse logon
>
> Hi Fotis,
>
> Here is my code:
>
> Do tSessObj.$port.$assign(iDBPort)
> Do tSessObj.$socket.$assign(iDBSocket)
> Do tSessObj.$database.$assign('lynx')
> Do tSessObj.$logon(iDBServer,'eyeway','pan7100','LynxSess') Returns iStatus
>
> This same code worked for MySQL but on Postres is not working.
> Although I connect to the database and create the session object, I
> cannot see the database name.
> Is it possible that my Postgres installation is wrong?
> By the way, I am using Postgres 9.0 on Windows Vista and XP with the
> same results.
>
> Thanks ,
>
> George
>
> Στις 20/12/2010 9:41 μμ, ο/η Fotis Georgiadis έγραψε:
>> Hi George,
>>
>> You need to first assign the database, then logon the session (if you use session objects)
>> Example:
>>
>> Do lvSession.$database.$assign('databaseName')
>> Do lvSession.$logon('localhost';'userName';'userPassword') Returns #F
>>
>> Then you can set the statement object etc...
>>
>> HTH,
>>
>> Fotis
>>
>> On 20 Δεκ 2010, at 6:25 μ.μ., George Panagopoulos wrote:
>>
>>> Hi all,
>>>
>>> I thought I give a try to postgres database and so I installed it to my test machine, migrate my MySql database to it and test it.
>>> After successfully logged on to the database I thought I try a SQL statement.
>>> Nothing! I searched a bit to find out what was wrong and I have found that the table in the statement needs a reference to the table.
>>>
>>> So this: SELECT * FROM sidebar doesn't work
>>> This : SELECT * FROM lynx.sidebar works.
>>>
>>> I presume that during the logon the $database doesn't pass the database name to the session object or I am not doing it right.
>>> By consequence, $select() and $fetch() do not work either.
>>>
>>> Any suggestions?
>>>
>>> TIA
>>>
>>>
>>> -- 
>>> Kind Regards,
>>>
>>> George Panagopoulos
>>> Omnis Programmer
>>> ByteCom
>>>
>>> _____________________________________________________________
>>> Manage your list subscriptions at http://lists.omnis-dev.com
>> _____________________________________________________________
>> Manage your list subscriptions at http://lists.omnis-dev.com
>>
>>
>>
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
>
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
>
>
>



More information about the omnisdev-en mailing list