Subject Re: [Firebird-Architect] Domains and NOT NULL in PSQL
Author Martijn Tonies
> > I'm not sure i understand your point, but the result of
> > CAST(<value> AS <domain>) should meet the domain constraints.
>
> Can you think of a case when a constraint could be violated as a result of
a
> cast operation? I.e. when CAST (<value> as <domain>) could be different
than
> CAST (<value> as TYPE OF <domain>)?

<value> = 4 (for some no apparent reason, eg: input from user)


CAST(4 as D_BOOLEAN)

where D_BOOLEAN is of type SMALLINT and has
CHECK(value in (0, 1) or value is null)



4 is a valid SMALLINT, but not a valid D_BOOLEAN

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com