[Cl-perec-devel] Schema evolution problem
Leslie P. Polzer
leslie.polzer at gmx.net
Tue Aug 26 10:25:43 UTC 2008
Consider the following, questions as comments in-line:
PRC(7): *db1*
#<POSTGRESQL-POSTMODERN {B026989}>
PRC(8): (defpclass bar nil nil)
#<PERSISTENT-CLASS BAR>
PRC(9): (let ((*database* *db1*)) (with-transaction (defparameter bar (make-instance
'bar))))
BAR
PRC(10): (let ((*database* *db1*)) (with-transaction (describe bar)))
#<BAR :persistent #t 30 {B68B411}>
is an instance of class #<PERSISTENT-CLASS BAR>.
The following slots have :INSTANCE allocation:
OID 1986950
PERSISTENT T
TRANSACTION NIL
TRANSACTION-EVENT :CREATED
;; I didn't use REVIVE-/LOAD-INSTANCE here, but no error is signaled.
;; Why?
PRC(12): (defpclass* bar nil ((s :type (or unbound text))))
#<PERSISTENT-CLASS BAR>
PRC(13): (let ((*database* *db1*)) (with-transaction (describe bar)))
#<BAR :persistent #t 30 {B68B411}>
is an instance of class #<PERSISTENT-CLASS BAR>.
The following slots have :INSTANCE allocation:
OID 1986950
PERSISTENT T
TRANSACTION NIL
TRANSACTION-EVENT :CREATED
debugger invoked on a SIMPLE-ERROR in thread #<THREAD "initial thread" RUNNING {A698799}>:
Accessing a persistent #<BAR :persistent #t 30 {B68B411}> while it is not attached to
the current transaction.
;; here an error *is* signaled...
;; continuing...
PRC(14): (let ((*database* *db1*)) (with-transaction (describe (revive-instance bar))))
debugger invoked on a CL-POSTGRES-ERROR:SYNTAX-ERROR-OR-ACCESS-VIOLATION in thread
#<THREAD "initial thread" RUNNING {A698799}>:
Database error 42703: column "_s" does not exist
Query: SELECT _s FROM _bar WHERE (_oid = $1::BIGINT)
;; now that's the real issue: why hasn't the column for slot S been created?
Leslie
More information about the cl-perec-devel
mailing list