Search Postgresql Archives

using = in a function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

I was reading the doc's on functions when I came across this:

"
An assignment of a value to a PL/pgSQL variable or row/record field is written as:

variable := expression;
"

and I realized, I didn't do that!  My assignments look like:

tmp = extract(minute from result);
if tmp > 30 then
	tmp = 60 - tmp;
	offset = tmp || ' minutes';
	result = result + offset;
else
	offset = tmp || ' minutes';
	result = result - offset;
end if;


Notice I just use = and not :=.

My question is, is there a difference? It seems to work both ways, so I'm a little confused.

Thanks,

-Andy

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux