Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!newsfeed0.kamp.net!newsfeed.kamp.net!feeder1.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.81.MISMATCH!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'schema': 0.05; 'subject:Python': 0.06; '"""': 0.07; 'definitions': 0.07; 'mysql,': 0.07; 'postgresql': 0.07; 'clause': 0.09; 'definition,': 0.09; 'postgresql,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'statements': 0.09; 'subject:2.7': 0.09; 'stored': 0.12; 'books': 0.15; '"scheme"': 0.16; "(it's": 0.16; '(via': 0.16; '18:': 0.16; '1989': 0.16; 'accesses': 0.16; 'dump': 0.16; 'message-id:@4ax.com': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'restricting': 0.16; 'there...': 0.16; 'wherein': 0.16; 'prevent': 0.16; 'basically': 0.19; 'file,': 0.19; 'items.': 0.19; 'machine': 0.22; 'appears': 0.22; 'select': 0.22; 'handles': 0.22; 'rules': 0.22; 'separate': 0.22; 'of.': 0.24; 'url:home': 0.24; 'mon,': 0.24; 'server.': 0.24; 'sort': 0.25; "i've": 0.25; 'define': 0.26; 'possibly': 0.26; 'tables': 0.26; 'supported': 0.26; 'gets': 0.27; 'header:X -Complaints-To:1': 0.27; 'feature': 0.29; 'database,': 0.30; 'restrict': 0.30; 'specified': 0.30; 'url:wiki': 0.31; "company's": 0.31; 'fighting': 0.31; 'relational': 0.31; 'restricted': 0.31; 'url:wikipedia': 0.31; 'username': 0.31; 'file': 0.32; 'figure': 0.32; 'another': 0.32; 'running': 0.33; 'framework': 0.33; 'standards': 0.33; 'table': 0.34; 'could': 0.34; '(2)': 0.35; 'requirement': 0.35; 'there': 0.35; '+0200,': 0.36; 'accessing': 0.36; 'data,': 0.36; 'impression': 0.36; 'oracle': 0.36; 'useful': 0.36; 'charset:us-ascii': 0.36; 'url:org': 0.36; 'application': 0.37; 'requirements': 0.37; 'two': 0.37; 'system,': 0.38; 'server': 0.38; '(3)': 0.38; 'nov': 0.38; 'others.': 0.38; 'needed': 0.38; 'to:addr:python-list': 0.38; 'von': 0.38; 'rather': 0.38; 'ability': 0.39; 'explain': 0.39; 'does': 0.39; 'itself': 0.39; 'to:addr:python.org': 0.39; 'either': 0.39; 'received:org': 0.40; 'called': 0.40; 'even': 0.60; 'read': 0.60; 'consists': 0.60; 'logged': 0.60; 'effective': 0.61; 'companies': 0.62; 'national': 0.62; 'address': 0.63; 'developed': 0.63; 'such': 0.63; 'field': 0.63; 'organization': 0.63; 'different': 0.65; 'account': 0.65; 'linked': 0.65; 'within': 0.65; 'american': 0.66; 'between': 0.67; 'incorporate': 0.68; 'sound': 0.68; 'containing': 0.69; 'integrated': 0.69; 'institute': 0.72; 'viewed': 0.74; 'address,': 0.75; 'business.': 0.80; 'article,': 0.84; 'greek': 0.84; 'handbook': 0.84; 'jet': 0.84; 'or...': 0.84; 'pre-packaged': 0.84; 'received:108': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert Date: Mon, 24 Nov 2014 13:44:04 -0500 Organization: IISS Elusive Unicorn References: <5d474a87-e2a5-43d3-b07c-4a1194880b4d@googlegroups.com> <54716987.7040301@gmail.com> <8d747a5biq4rc559tvgju088508bp0o2gv@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-108-79-223-64.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 72 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1416854656 news.xs4all.nl 2961 [2001:888:2000:d::a6]:45924 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:81467 On Mon, 24 Nov 2014 10:05:11 +0200, "Frank Millman" declaimed the following: >I will explain why such a feature would have been useful for me. > >My accounting system handles multiple companies. I needed to figure out a >way to keep each one's data separate from the others. > >Originally I supported two databases - PostgreSQL and Sql Server. They both >have a concept called 'schemas', which handles my requirement elegantly - >each company's data is stored in its own schema. > We must have a different impression of what a "schema" consists of. As I learned it, the "schema" basically came down to the statements defining the form of the data, the rules (triggers) on it, and the relationships between data items. http://en.wikipedia.org/wiki/Database_schema By that definition, SQLite3 does support "schemas" (it's all the DDL statements used to create the database less the data itself -- which are DML). So does Firebird, MySQL, Access/JET (Based on the linked article, your usage appears to be the Oracle definition... Interestingly -- out of the three books I have on PostgreSQL, only one even has the word schema involved, and the description makes it sound like just another layer; sort of a sub-database restricted by username within the main database -- you still have to recreate the table definitions within it) Handbook of Relational Database Design (Fleming & von Halle, 1989 Addison-Wesley) page 18: """ In 1977, the American National Standards Institute ... developed a set of requirements for effective DBMSs. These requirements were specified in terms of a three-part framework for organizing data managed by a DBMS: (1) the /external schema/, or data organization as viewed by the user or programmer; (2) the /internal schema/, or data organization as viewed by the DBMS's internal access logic; and (3) the /conceptual schema/, or integrated view of all data employed within the business. """ I've got another three or four theory books that use the English "scheme" rather than the Greek "schema". For a client-server database system, with ability to restrict access based upon user accounts/host address, there are a number of ways to address the separation. Either each user account (company) gets its own database in the server -- possibly using the same pre-packaged DML to define the tables/etc -- and one uses the access control system to prevent an account from even knowing there are other databases out there... Or... there is one set of tables (one database) containing data from all the companies -- wherein each table has a field identifying the company, and ALL accesses to the data is via views that incorporate a select clause restricting the data to the current logged in company. Since SQLite3 is a file-server database, with each user program directly accessing the file, there is no user authorization phase (if you have read access to the database file on the machine, you could copy it to a machine with R/W privileges and dump all the data). No different than M$ Access/JET (MDB/ACCDB files). JET is also a file-server -- each copy of a running application is fighting for access to the same file (via locks); there is no master server arbitrating access requests. -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/