On Saturday 28 January 2006 07:06, Echo wrote: > Hello, > I've been working on adding the ability to create tables easily on any > database to Dabo. > I have created a diff and put it at the end of this email. It fully > works with SQLite. I haven't started on any of the other databases > yet. > So I was wondering if the way I created it was good or not. I would > like to know your opinions before I started the support for other > databases. > > -- > -Echo > A few month ago (maybe A LOT longer) I looked into this issue. I only investagated the Postgres engine (7.4 - 8.0). I found several issues starting with the permissions of the client (user). What ever client program that is accessing the database - the login user must have the ability to "createDB" or create the database (and possiblely more). This can be determined by reading several of the "pg" system tables. I also checked with the postgres user list and discovered that the common practice of creating the database, tables, etc.... was done via a sql script. Also the sql script is run on the postgres server as the special postgres user. In fact within postgres you can create a special modified template (from template1) that can contain many additional features your database might require. So bottom line is the logged in user must be an administrator and might have to pass several parameters to correctly create the required database, tables, indexes, etc. Of course this all starts with the user having access to the postgres engine in the first place.
Having said above you can just attempt to create the database and fail. Attempting to use different users such as the "postgres" user would violate the security of the postgres engine. I know you don't want to do that. So I decided not to attempt to swim up stream. I just manually create my database and tables - then do a "pg_dump" (a postgres script) which creates the sql script. Then an administrator can run my script. John _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
