RE: [HACKERS] NULL handling question
От | Michael Davis |
---|---|
Тема | RE: [HACKERS] NULL handling question |
Дата | |
Msg-id | 93C04F1F5173D211A27900105AA8FCFC1452E4@lambic.prevuenet.com обсуждение исходный текст |
Список | pgsql-hackers |
I would like to have a C function and/or stored procedure that can accept a null parameter value and return a non-null value. Thanks, Michael -----Original Message-----From: D'Arcy" "J.M." Cain [SMTP:darcy@druid.net]Sent: Monday, March 29, 1999 10:27 AMTo: lockhart@alumni.caltech.eduCc: neko@kornel.szif.hu; hackers@postgreSQL.orgSubject: Re: [HACKERS] NULL handlingquestion Thus spake Thomas Lockhart> > I don't seek this in the source, but i think, all function, who take a > > NULL value as parameter can't return with a NOT NULL value.> > But why?> > Postgres assumes that a NULL inputwill give a NULL output, and never> calls your routine at all. Since NULL means "don't know", there is a Actually, the problem is that it does call the function. After itreturns it throws away the result and so the effect isthat the functionnever gets called but in the meantime, the function has to deal withNULL inputs for nothing. This has been hangingaround since the lastrelease. I looked at the dispatch code but it wasn't very clear wherewe have to put the test to do this correctly. Maybe we can get it cleanedup before release this time. > strong argument that this is correct behavior. I agree but recently I said that there was no stored procedures in PostgreSQLand someone corrected me pointing out that functions with no return werein effect stored procedures. Do the same arguments apply? If a procedureis passed a NULL argument, should the side effects be bypassed? -- D'Arcy J.M. Cain <darcy@{druid|vex}.net> | Democracy is three wolveshttp://www.druid.net/darcy/ | and a sheep voting on+1 416 424 2871 (DoD#0082) (eNTP) | what'sfor dinner.
В списке pgsql-hackers по дате отправления: