Forum OpenACS Q&A: Re: Rudimentary development method questions

Collapse
Posted by Tilmann Singer on
Plpgsql doesn't support default values like Oracle pl/sql does.

Just a clarification: when porting from oracle to postgresql the default values have been preserved as inline comments, so that the caller knows which values to set if the defaults are desired, kludging around the fact that plpgsql doesn't support default values like plsql. In plpgsql you would have to call the proc above somehow like this:

select note__new(
  null,
  null,
  :title,
  :body,
  'note',
  now(),
  null,
  null,
  null
)
when you only want to specify the two required arguments, title and body.

If that's a common way to call that procedure then the package author could provide an overloaded variant of the procedure that only takes these two arguments for convenience, like:

note__new(varchar, varchar)