[SQL] booleans and nulls
Out of curiousity, 1. Does a boolean column occupy 1byte of disk whether or not the value is null or not? 2. Is matching on IS NULL or = 0 more efficient? 3. If I ix'd columns w/ null does postgres know whatevers not indexed is null or would their be no point? I currently utilize null fields as 'not a value' has meaning in a program i've been working on as I don't want to put false in every column when i only need a couple with a true/false value. I'm not joining tables on NULLS, just filtering w/ them. Thanks __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
[SQL] nullif('','') on insert
I need to test whether or not a value is null on insert. Example: insert into table (column) values nullif('','')); ERROR: column "column" is of type boolean but expression is of type text. It works in MSSQL (probably against not standards) but nonetheless I need to make it work. I assume it's returning 'NULL' w/ quotes? I don't know where to look to alter it. I looked into functions but all I see is how to write "AS queries" or point to various snippets. I'd rather just alter the nullif function. Is there a function for this or could someone give me an example to insert NULL? Cheers Matt __ Yahoo! Mail for Mobile Take Yahoo! Mail with you! Check email on your mobile phone. http://mobile.yahoo.com/learn/mail ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly