Re: [HACKERS] How to embed postgresql?

2009-06-16 Thread dror

In addition to my last comment, if you are looking fior real embedded database 
then Postgress does not fit your needs unless you would like to work with it as 
Server mode.
With H2 (or Derby) you can work in Server mode or in embbedded mode and both 
are much suitable for Java applications.
Regards

Dror


From: dro...@hotmail.com
To: sua...@gmail.com; pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] How to embed postgresql?
Date: Tue, 16 Jun 2009 05:56:09 +



If you are working with Java, it is better for you to check H2 database, we 
also have Java application and until recently we worked with Postgres,  few 
month ago we replaced it with H2.
Regards
Dror
 


Date: Tue, 16 Jun 2009 12:13:38 +0800
Subject: [HACKERS] How to embed postgresql?
From: sua...@gmail.com
To: pgsql-hackers@postgresql.org


Dears,
 
How to embed postgresql if possible?
 
In our Java application solution, we need an embedded database. Berkeley DB can 
not meet our reqirements in performance and license, so we wish to port 
postgresql as embedded database.
 
Architecture: Java - JNI - the API is wrapped from Plan/Executor modules
 
What's the feasibility? If it's possible, look for your coaching!
 
Many thanks!
 
Bruce
 
 
 


Hotmail® has ever-growing storage! Don’t worry about storage limits. Check it 
out.
_
Lauren found her dream laptop. Find the PC that’s right for you.
http://www.microsoft.com/windows/choosepc/?ocid=ftp_val_wl_290

Re: [HACKERS] How to embed postgresql?

2009-06-15 Thread dror

If you are working with Java, it is better for you to check H2 database, we 
also have Java application and until recently we worked with Postgres,  few 
month ago we replaced it with H2.

Regards

Dror
 


Date: Tue, 16 Jun 2009 12:13:38 +0800
Subject: [HACKERS] How to embed postgresql?
From: sua...@gmail.com
To: pgsql-hackers@postgresql.org


Dears,
 
How to embed postgresql if possible?
 
In our Java application solution, we need an embedded database. Berkeley DB can 
not meet our reqirements in performance and license, so we wish to port 
postgresql as embedded database.
 
Architecture: Java - JNI - the API is wrapped from Plan/Executor modules
 
What's the feasibility? If it's possible, look for your coaching!
 
Many thanks!
 
Bruce
 
 
 
_
Hotmail® has ever-growing storage! Don’t worry about storage limits.
http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage_062009

Re: [HACKERS] Bug with initDB under windows 2003

2006-08-21 Thread dror


Hi Magnus,

After trying to unlock the nul device using:
Subinacl/serviceNULL/grant="authenticatedusers"=QSEILU

It doesn't solve the problem (even after restating the machine) 

Here is the new output from running "Subinacl/serviceNULL" after the change

For Administrator:

==+Service NULL==/control=0x0/owner =system/primary group =system/audit ace count =1/aace =everyone SYSTEM_AUDIT_ACE_TYPE-0x2 FAILED_ACCESS_ACE_FLAG-0x80 FAILED_ACCESS_ACE_FLAG-0x0x80 SERVICE_ALL_ACCESS/perm. ace count =6/pace =system ACCESS_ALLOWED_ACE_TYPE-0x0 SERVICE_QUERY_CONFIG-0x1 SERVICE_QUERY_STATUS-0x4 SERVICE_ENUMERATE_DEPEND-0x8 SERVICE_START-0x10 SERVICE_STOP-0x20 SERVICE_PAUSE_CONTINUE-0x40 SERVICE_INTERROGATE-0x80 READ_CONTROL-0x2 SERVICE_USER_DEFINED_CONTROL-0x0100/pace =builtin\administrators ACCESS_ALLOWED_ACE_TYPE-0x0 SERVICE_ALL_ACCESS/pace =interactive ACCESS_ALLOWED_ACE_TYPE-0x0 SERVICE_QUERY_CONFIG-0x1 SERVICE_QUERY_STATUS-0x4 SERVICE_ENUMERATE_DEPEND-0x8 SERVICE_INTERROGATE-0x80 READ_CONTROL-0x2 SERVICE_USER_DEFINED_CONTROL-0x0100/pace =service ACCESS_ALLOWED_ACE_TYPE-0x0 SERVICE_QUERY_CONFIG-0x1 SERVICE_QUERY_STATUS-0x4 SERVICE_ENUMERATE_DEPEND-0x8 SERVICE_INTERROGATE-0x80 READ_CONTROL-0x2 SERVICE_USER_DEFINED_CONTROL-0x0100/pace =builtin\power users ACCESS_ALLOWED_ACE_TYPE-0x0 SERVICE_QUERY_CONFIG-0x1 SERVICE_QUERY_STATUS-0x4 SERVICE_ENUMERATE_DEPEND-0x8 SERVICE_START-0x10 SERVICE_STOP-0x20 SERVICE_PAUSE_CONTINUE-0x40 SERVICE_INTERROGATE-0x80 READ_CONTROL-0x2 SERVICE_USER_DEFINED_CONTROL-0x0100/pace =authenticated users ACCESS_ALLOWED_ACE_TYPE-0x0 SERVICE_QUERY_CONFIG-0x1 SERVICE_QUERY_STATUS-0x4 SERVICE_ENUMERATE_DEPEND-0x8 SERVICE_INTERROGATE-0x80 READ_CONTROL-0x2 SERVICE_USER_DEFINED_CONTROL-0x0100
Elapsed Time: 00 00:00:00Done: 1, Modified 0, Failed 0, Syntax errors 0Last Done : NULLAnyway,
It obvious that it some kind of permission issue, but even if this command would have solved the problem it is still mean thatthe installer shell runthat command before calling to initDB, in order to validate that the user can run the initDB (as it written today), Or adding limitation\Warning to the userfor known issue and suggest the workarounddevice,
Or 
Changing the initDB code that it should test the nul device permission before forwarding output to there
Or
Fix the code asI suggested (but unfortunately rejected by Tom).

Regards
Dror



 Subject: RE: [HACKERS] Bug with initDB under windows 2003 Date: Mon, 21 Aug 2006 13:26:11 +0200 From: [EMAIL PROTECTED] To: [EMAIL PROTECTED]; kleptog@svana.org CC: pgsql-hackers@postgresql.org  I'dbeinterestedinseeingtheoutputfromthecommand: Subinacl/serviceNULL  Onasystemwherethisdoesnotwork.   Hereistheoutputfor"Subinacl/serviceNULL" Both,fortheAdministratoruserandforthePostgresuser:  Thanks.   Postgresuser: Subinacl/serviceNULL SeSecurityPrivilege:Accessisdenied. WARNING:UnabletosetSeSecurityPrivilegeprivilege.This privilegemayberequired. ErrorOpenSCManager:Accessisdenied.  That'squitenormal-thepostgresuserdoesn'thavepermissiontoopen theSCManagertoviewthepermissions,becauseit'snotaPowerUser.   Administratoruser:  Thisisgood.ItshowsoneverycleardifferencefromwhatIhaveona workingsystem,whichis:  /pace=authenticatedusersACCESS_ALLOWED_ACE_TYPE-0x0 SERVICE_USER_DEFINED_CONTROL-0x0100  Onmysystem,Ihave: /pace=authenticatedusersACCESS_ALLOWED_ACE_TYPE-0x0 SERVICE_QUERY_CONFIG-0x1SERVICE_QUERY_STATUS-0x4  SERVICE_ENUMERATE_DEPEND-0x8 SERVICE_INTERROGATE-0x80READ_CONTROL-0x2  SERVICE_USER_DEFINED_CONTROL-0x0100Sothisistheproblem.Nowtofigureouthowtofixit:-)FromwhatI cantellitsimplyneedstoaddbackthemissingACEflags.Thiscommand hopefullyshouldwork(nottestedapartfromthesyntax,sinceIdon't haveagoodtestigplace,butpleasetryitandifitdoesn'tworksee ifyoucanfigureoutwhattochange):  Subinacl/serviceNULL/grant="authenticatedusers"=QSEILU   Youneedtorunthisasadministratorofcourse,butitshouldhopefully unlocktheNULdeviceagain.  //Magnus Express yourself instantly with Windows Live Messenger! Windows Live Messenger!


Re: [HACKERS] Bug with initDB under windows 2003

2006-08-20 Thread dror


Hi Magnus,

Magnus Wrote:
 I'dbeinterestedinseeingtheoutputfromthecommand: Subinacl/serviceNULL  Onasystemwherethisdoesnotwork. 

Here is the output for "Subinacl/serviceNULL"
Both, for the Administrator user and for the Postgres user:

Postgres user:
Subinacl /service NULLSeSecurityPrivilege : Access is denied.
WARNING :Unable to set SeSecurityPrivilege privilege. This privilege may be required.Error OpenSCManager : Access is denied.
Elapsed Time: 00 00:00:00Done: 0, Modified 0, Failed 0, Syntax errors 0
--
Administrator user:

==+Service NULL==/control=0x0/owner =system/primary group =system/audit ace count =1/aace =everyone SYSTEM_AUDIT_ACE_TYPE-0x2 FAILED_ACCESS_ACE_FLAG-0x80 FAILED_ACCESS_ACE_FLAG-0x0x80 SERVICE_ALL_ACCESS/perm. ace count =6/pace =system ACCESS_ALLOWED_ACE_TYPE-0x0 SERVICE_QUERY_CONFIG-0x1 SERVICE_QUERY_STATUS-0x4 SERVICE_ENUMERATE_DEPEND-0x8 SERVICE_START-0x10 SERVICE_STOP-0x20 SERVICE_PAUSE_CONTINUE-0x40_INTERROGATE-0x80 READ_CONTROL-0x2 SERVICE_USER_DEFINED_CONTROL-0x0100/pace =builtin\administrators ACCESS_ALLOWED_ACE_TYPE-0x0 SERVICE_ALL_ACCESS/pace =interactive ACCESS_ALLOWED_ACE_TYPE-0x0 SERVICE_QUERY_CONFIG-0x1 SERVICE_QUERY_STATUS-0x4 SERVICE_ENUMERATE_DEPEND-0x8 SERVICE_INTERROGATE-0x80 READ_CONTROL-0x2 SERVICE_USER_DEFINED_CONTROL-0x0100/pace =service ACCESS_ALLOWED_ACE_TYPE-0x0 SERVICE_QUERY_CONFIG-0x1 SERVICE_QUERY_STATUS-0x4 SERVICE_ENUMERATE_DEPEND-0x8 SERVICE_INTERROGATE-0x80 READ_CONTROL-0x2 SERVICE_USER_DEFINED_CONTROL-0x0100/pace =authenticated users ACCESS_ALLOWED_ACE_TYPE-0x0 SERVICE_USER_DEFINED_CONTROL-0x0100/pace =builtin\power users ACCESS_ALLOWED_ACE_TYPE-0x0 SERVICE_QUERY_CONFIG-0x1 SERVICE_QUERY_STATUS-0x4 SERVICE_ENUMERATE_DEPEND-0x8 SERVICE_START-0x10 SERVICE_STOP-0x20 SERVICE_PAUSE_CONTINUE-0x40_INTERROGATE-0x80 READ_CONTROL-0x2 SERVICE_USER_DEFINED_CONTROL-0x0100
Elapsed Time: 00 00:00:00Done: 1, Modified 0, Failed 0, Syntax errors 0Last Done : NULL


As you can see it failed toset SeSecurityPrivilege privilege for the Postgres user.
Regards
Dror;



 Subject: Re: [HACKERS] Bug with initDB under windows 2003 Date: Fri, 18 Aug 2006 14:33:58 +0200 From: [EMAIL PROTECTED] To: [EMAIL PROTECTED]; kleptog@svana.org; [EMAIL PROTECTED] CC: pgsql-hackers@postgresql.org  Haveyoubeenabletodetermine*why*Microsoftmadethis braindead decision?Orwhereit'sdocumented?Theirownknowledgebaseis filled withexamplesofusingthedevice,soIimaginethey'llhaveto posta workaroundsomewhere...  AFAIK,nobodyhaspostedanylinkstoinformationthatshowsthat Microsoftactually*did*changethis.I'vesearchedtheirKBsome (includingthepartner-onlyoneforpeoplewiththepaid agreements,whichcontainsinformationaboutbugsthattheydon't wanttobepublic),andfindnothingaboutit.  Unlessyoucanreproducethisonacleansystem,I'mdefinitely inclinedtosaythisiscausedbysomeotherpieceofsoftwareon themachine-firewall,antivirus,antispywareorvirus/spyware itself.  Actually,I'vebeenabletofindsomemoreinformationaboutthis,which confirmsthattheproblemisaccessrightsontheNULdevice,butit's *NOT*setbyaMSsecuritypatch.  I'dbeinterestedinseeingtheoutputfromthecommand: Subinacl/serviceNULL  Onasystemwherethisdoesnotwork.  (Ifyougetanemptyupdate,makesureyouhaveaversionofsubinacl thatcorrespondstoyourwindowsversion)  (Thereareknownappsthatmessthisup,butmyNDApreventsmefrom tellingyouwhichone(s)...)  //Magnus   ---(endofbroadcast)--- TIP4:Haveyousearchedourlistarchives?  http://archives.postgresql.orgBe one of the first to try Windows Live Mail. Windows Live Mail.


Re: [HACKERS] [PATCHES] [Patch] - Fix for bug #2558, InitDB failed

2006-08-15 Thread dror


Hi All,

I agree with all of you that it is strange behavior, more then that :
On two win 2003 machines with the same SP and last hot fixes, on one the nul device is accessible by non admin user and on other it is not.
I also agree that the source of the problem might be something that effect the OS configuration (as avirusscanner for example).
The source of the problem and the right diagnostic is important, but right now we have problem (unknown) with the nul device on some of the system.
I don't see any risk with canceling the redirection nor with open a log file (with permission to thepostgres user), if a commercial DB, as EnterpriseDB, choose this solution (Log file) I don't see any reason why not to do the same.

Does anyoneknow why EnterpriseDB changed the nul redirection?

Regards
Dror




 Date: Tue, 15 Aug 2006 11:37:30 +0200 From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] CC: pgsql-hackers@postgresql.org; [EMAIL PROTECTED]; pgsql-patches@postgresql.org Subject: Re: [HACKERS] [PATCHES] [Patch] - Fix for bug #2558, InitDB failed to run  TomLanewrote: AndrewDunstan[EMAIL PROTECTED]writes:  IammorethansomewhatperplexedastowhytheNULdeviceshouldbea securityrisk...whataretheythinking??   Frankly,Idon'tbelieveit;evenMicrosoftcan'tbethatstupid. AndIcan'tfindanysuggestionthatthey'vedonethisinagoogle search.IthinktheOPismisdiagnosinghisproblem.  Anoldermessagesuggeststhataservicepackinducedthisproblem,per MS.Ijusttrieditasnon-adminonaW2K3machinewithrecenthotfixes, andthecommand"dirnul"_did_workforme. Thoughneglected,itstillsoundslikeavirusscannerissuetome.  Regards, Andreas   ---(endofbroadcast)--- TIP3:HaveyoucheckedourextensiveFAQ?  http://www.postgresql.org/docs/faqBe one of the first to try Windows Live Mail. Windows Live Mail.


Re: [HACKERS] [PATCHES] [Patch] - Fix for bug #2558, InitDB failed

2006-08-15 Thread dror


In addition to Andreas respond:
1+2) Currently the initDB is used the tmp folder to write other "Helper files" that are deleted afterwards.

The fix is suggested only for win machines ,I think that redirection is more risky (as we saw with this bug) than to do redirect output to alog file that you createdand control it ,you gave the permission to and know exactly what its status (even if the reason is that some virus scanner or any other software blocked access to one device or another).
But, I suggest a new improvement:
Check the status and if the command failed than run itwithout redirection at all, (actually no redirection is needed in this case , you can always run the processin silent mode).

The interesting question that didn't get any answer yet is:
Why EnterpriseDB (which is based on postgress) find it important to change the redirection?Regards
Dror,



 Date: Tue, 15 Aug 2006 19:10:27 +0200 From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] CC: [EMAIL PROTECTED]; pgsql-hackers@postgresql.org; [EMAIL PROTECTED] Subject: Re: [HACKERS] [PATCHES] [Patch] - Fix for bug #2558, InitDB failed to run  TomLanewrote: AndreasPflug[EMAIL PROTECTED]writes:  whatissuesmightariseiftheoutputisredirectedtoalegaltmpfile?   Well,(1)findingaplacetoputthetempfile,ieawritabledirectory; (2)ensuringthefileisremovedafterwards;(3)notexposingtheuser tosecurityhazardsduetounsafeuseofatempfile(yeolde overwrite-a-symlinkrisk).PerhapsafewmoreIdidn'tthinkof.   AFAICSallDEVNULLusagesresultfromredirectingpostmaster'soutput, whichusuallygoesto$DATADIR/serverlogatruntime.Ifthiswouldbe usedheretoo,(1)isassafeasany$DATADIR,(2)isassafeas cleaningupafterfailureusuallyis,(3)can'thappenbecausethe directoryischeckedtobeemptybeforeinitdbanyway.Additionally, there'smightbecaseswhenameaningfullogfilefrominitdbis desirabletoo.Sowhynoredirectiontoinitlogorso?  Regards, Andreas---(endofbroadcast)--- TIP6:explainanalyzeisyourfriendBe one of the first to try Windows Live Mail. Windows Live Mail.


Re: [HACKERS] Bug with initDB under windows 2003

2006-08-03 Thread dror


Hi James,

I just wanted to inform you all that I solvethe issue, it was indeed the nul device as James and Martijn mention.
I have change the source to redirect the output to a log file, to which I gave permission to the "postgres" user.
The file (currently) is created at the temp folder.
This is critical bug due to the fact that on more and more win2003 machines the postgres installation failed to initialize the DB.

In any case, I am about to push this fix to be part of the formal postgres source.Is anyone know ,who should I write to in order to test and checked this fix to the CSV.
Regards
DrorExpress yourself instantly with Windows Live Messenger! Windows Live Messenger!


[HACKERS] Bug with initDB under windows 2003

2006-08-02 Thread dror bar


Hi All,

On some windows 2003 machines the initDB process failed with the following error:


Running in debug mode.The files belonging to this database system will be owned by user "V_MYUSER".This user must also own the server process.

The database cluster will be initialized with locale English_United States.1252.

fixing permissions on existing directory E:/Postgres\Data ... okcreating directory E:/Postgres\Data/global ... okcreating directory E:/Postgres\Data/pg_xlog ... okcreating directory E:/Postgres\Data/pg_xlog/archive_status ... okcreating directory E:/Postgres\Data/pg_clog ... okcreating directory E:/Postgres\Data/pg_subtrans ... okcreating directory E:/Postgres\Data/pg_twophase ... okcreating directory E:/Postgres\Data/pg_multixact/members ... okcreating directory E:/Postgres\Data/pg_multixact/offsets ... okcreating directory E:/Postgres\Data/base ... okcreating directory E:/Postgres\Data/base/1 ... okcreating directory E:/Postgres\Data/pg_tblspc ... okselecting default max_connections ... Access is denied.Access is denied.Access is denied.Access is denied.Access is denied.Access is denied.10selecting default shared_buffers ... Access is denied.Access is denied.Access is denied.Access is denied.Access is denied.Access is denied.Access is denied.Access is denied.Access is denied.Access is denied.Access is denied.50creating configuration files ... okcreating template1 database in E:/Postgres\Data/base/1 ... VERSION=8.1.4PGDATA=E:/Postgres\Datashare_path=E:/Program Files/postgres/Database/sharePGPATH=E:/Program Files/postgres/Database/binPOSTGRES_SUPERUSERNAME=V_MYUSERPOSTGRES_BKI=E:/Program Files/postgres/Database/share/postgres.bkiPOSTGRES_DESCR=E:/Program Files/postgres/Database/share/postgres.description

The EnterpriseDB database which is based on postgress works fine.
After short investigation, I found that this is not the first case this behavior was seen.
It seems that the bug is some how connected toaccess permissionfor the'nul' device.
The initDB.c trying to run something like:
postgres.exe -boot -x0 -F -c shared_buffers=200 -c max_connections=40 template1 "/nul" 
After looking at EnterpiseDB and some other help I think the PostgreSQL sourceneed to be modifiedand re-direct the output from postgres.exe to a file and grants access (to the file) to the postgres service user.

I am willing to contribute and do this fix and appreciate commentsfrom others who already familiar with this issue.

Regards
DrorWith MSN Spaces email straight to your blog. Upload jokes, photos and more. It's free! It's free!