O$ PostgreSQL large objects and OSX

Mike Matthews omnis at lineal.co.uk
Wed Jun 24 03:26:14 EDT 2015


Hello Doug,

Struggling with the newer here.  Are you saying keep the whole file as a record in the DB or just a pointer to the file on the shared resource?

And is Andrew's problem with paths to do with posix vs Mac HFS I wonder?

Do FileOps.$getfilename(#S1)   =   Macintosh HD:Users:mike:Desktop:BBC-Radio2.webloc
Do FileOps.$converthfspathtoposixpath(#S1,#S2)  =  /Users/mike/Desktop/BBCRadio2.webloc


See you at EurOmnis 2015 as well, looking forward to that. :)

Mike







Mike Matthews,
 Managing Director, SQLWorks Software Ltd

Tel: +44 (0)1271 375999

Email: mike.matthews at sqlworks.co.uk

Web: www.sqlworks.co.uk

SQLWorks replaces Sage, ACT!, Opera, Access, SAP

On 24 Jun 2015, at 05:59, Doug Easterbrook <doug at artsman.com> wrote:

> hi all:
> 
> I’ll probably get shot on this one …   but LOB is just a large object, binary or character.
> 
> so why try to access the database file structure and do a hybrid   ‘here’s a file and I’ll only save the pointer in the database??’
> 
> it just seems so much more reasonable to do an update to a table using standard sql like
> 
> update table set blob=[@blobvalue]
> 
> that way, if you delete the row, the blob goes
> 
> and if you back up the database, the blob gets backed up.
> and, its platform independent.
> and its fully ACID.
> and its easy to restore a database.
> 
> 
> 
> 
> it just doesn’t make sense to me to try this save the document via the file system and update the database with a value …   I know.. people say, there are advantages.    but it really escapes me on the most basest sense why to do it.
> 
> 
> I hope to be enlightened.
> 
> 
> 
> Doug Easterbrook
> Arts Management Systems Ltd.
> mailto:doug at artsman.com
> http://www.artsman.com
> Phone (403) 536-1205    Fax (403) 536-1210
> 
>> On Jun 23, 2015, at 6:06 PM, Andrew Clow <andrew at freedomsoftware.co.nz> wrote:
>> 
>> Thanks Bas,
>> I thought of the workaround but was hoping to avoid it, and I’m not sure if I’ll be able to get the import working with a workaround.
>> 
>> I’ll check if DLA can supply an updated DAM (assuming one exists) otherwise start working on the workaround unless there are some other $listers with suggestions.
>> 
>> Regards,
>> Andrew.
>> 
>>> On 24/06/2015, at 11:37 am, Bastiaan Olij <bastiaan at basenlily.me> wrote:
>>> 
>>> Hi Andrew,
>>> 
>>> I had similar issues with creating the debug log you can enable for the
>>> Postgres DAM. I think the Postgres side of life is converting the Mac
>>> path to a Linux path but the OS is still expecting a Mac path.
>>> I think the issue with the debug log was fixed in a later version of the
>>> DAM and may apply to this as well but I don't know if this is thus
>>> available in the latest 5 release or only 6 or if it is still a problem
>>> for these particular functions.
>>> 
>>> You might want to check with TL if they have a newer DAM available for
>>> you that fixes this issue.
>>> 
>>> Only workaround I can suggest is putting the file in the root and after
>>> that moving it to the desired location, not neat and not all users may
>>> have rights to do so.
>>> 
>>> Cheers,
>>> 
>>> Bas
>>> 
>>> On 24/06/2015 9:17 am, Andrew Clow wrote:
>>>> Hi,
>>>> 
>>>> Using Omnis Studio 5.2.3 with Postgres DAM on both Windows & OSX.
>>>> 
>>>> I've been experimenting with $lobimport & $lobexport and got it working smoothly on Windows, but I'm having an issue with the implementation on OSX and hoping someone out there is using them successfully.
>>>> 
>>>> $lobimport(lcFilePath) returns 0  (nothing is imported/created and no error is logged by the Postgres Server)
>>>> $lobexport(lcFilePath,$cinst.fs_oid) returns kTrue, but the file is generated in the root directory and not the selected path.
>>>> 
>>>> E.g. If lcFilePath is "Macintosh HD:Andrew:Desktop:Testfile.txt" Omnis creates the file as "Macintosh HD/Andrew/Desktop/Testfile.txt" in the root directory.
>>>> 
>>>> I suspect that this path issue is also preventing the $lobimport method from working.
>>>> I've tried replacing all the path separators prior to import/export but that results in the same failure.
>>>> 
>>>> Can anyone think of what I might be missing regarding filepath on OSX?
>>>> 
>>>> All my other OSX file generation with $putfilename works, although most of it is via BrainyData's PDF external or $writecharacter.
>>>> 
>>>> For reference the code that's working on Windows is:
>>>> :: Import method in table class.
>>>> Do FileOps.$getfilename(lcFilePath,'Select File to import...','*.*',lDirectory)
>>>> If not(isclear(lcFilePath))
>>>> Do $cinst.$sessionobject().$transactionmode.$assign(kSessionTranManual)
>>>> Do $cinst.$sessionobject().$begin()
>>>> Do $cinst.$sessionobject().$lobimport(lcFilePath) Returns $cinst.fs_oid
>>>> If $cinst.fs_oid
>>>> Do $cinst.$save() Returns bResultState
>>>> If bResultState
>>>> Do $cinst.$sessionobject().$commit()
>>>> Else
>>>> Do $cinst.$sessionobject().$rollback()
>>>> End If
>>>> Else
>>>> Do $cinst.$sessionobject().$rollback()
>>>> End If
>>>> Do $cinst.$sessionobject().$transactionmode.$assign(kSessionTranAutomatic)
>>>> End If
>>>> Quit method bResultState
>>>> 
>>>> :: Export method in table class.
>>>> Do FileOps.$putfilename(lcFilePath,'Download file to...','*.*',lDirectory)
>>>> If not(isclear(lcFilePath))
>>>> Do $cinst.$sessionobject().$transactionmode.$assign(kSessionTranManual)
>>>> Do $cinst.$sessionobject().$begin()
>>>> Do $cinst.$sessionobject().$lobexport(lcFilePath,$cinst.fs_oid) Returns bResultState
>>>> Do $cinst.$sessionobject().$rollback()
>>>> Do $cinst.$sessionobject().$transactionmode.$assign(kSessionTranAutomatic)
>>>> End If
>>>> Quit method bResultState
>>>> 
>>>> Regards,
>>>> Andrew Clow
>>>> 
>>>> _____________________________________________________________
>>>> 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