> From: E.Pasma <pasm...@concepts.nl> > Digital Dog wrote: > > > > PRAGMA default_without_rowid = on > > To make all tables created while the directive is in use the WITHOUT ROWID > > tables. > ..
> > > > PRAGMA enforce_not_null_on_primary_key = on > > For WITHOUT ROWID tables it would be a no-op, but for rowid tables it would > > restore correct behavior. > Hello, just a remark about this second pragma. > Enforce_not_null_on+primary_key seems obsolete to me, also for "rowid" tables, that do not > have a primary key defined. > Because once the first suggested pragma (default_without_rowid) is set, this rowid will be > treated as a true integer primary key, including the NOT NULL property. And this also applies > if a table is defined with INTEGER PRIMARY KEY as an alias for roiwid. > Does that leave only the first suggestion? I may have phrased the subject in a wrong way which misguided you. My idea is to be able to apply these pragmas separately, I mean a user can opt-in to using just the second PRAGMA because for a valid reason rowid tables are better choice for their database. This pragma would make SQLite's behaviour consistent between rowid and WITHOUT_ROWID tables with respect to handling primary key values (i.e. failing on NULL). This setting obviously wouldn't do anything useful to tables without a primary key. But if in the future SQLite authors implement ALTER TABLE ... ADD CONSTRAINT ... PRIMARY KEY, then the setting will be taken into account as well. default_without_oid is a switch which now would allow changing old default behaviour - i.e. I decide that I want all subsequently created tables in my database to be WITHOUT OID without specifying that in the CREATE TABLE script. It also gives the SQLite authors the ability to change default value of this setting for new databases in the future, and then the directive will be the way to restore old/deprecated (by then) way of creating tables. Thanks! _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users