{"action":"created","issue":{"url":"https://api.github.com/repos/greenplum-db/gpdb/issues/247","labels_url":"https://api.github.com/repos/greenplum-db/gpdb/issues/247/labels{/name}","comments_url":"https://api.github.com/repos/greenplum-db/gpdb/issues/247/comments","events_url":"https://api.github.com/repos/greenplum-db/gpdb/issues/247/events","html_url":"https://github.com/greenplum-db/gpdb/pull/247","id":125349968,"number":247,"title":"DEFAULT paramters of UDF ported from PostgreSQL.","user":{"login":"kuien","id":14087289,"avatar_url":"https://avatars.githubusercontent.com/u/14087289?v=3","gravatar_id":"","url":"https://api.github.com/users/kuien","html_url":"https://github.com/kuien","followers_url":"https://api.github.com/users/kuien/followers","following_url":"https://api.github.com/users/kuien/following{/other_user}","gists_url":"https://api.github.com/users/kuien/gists{/gist_id}","starred_url":"https://api.github.com/users/kuien/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kuien/subscriptions","organizations_url":"https://api.github.com/users/kuien/orgs","repos_url":"https://api.github.com/users/kuien/repos","events_url":"https://api.github.com/users/kuien/events{/privacy}","received_events_url":"https://api.github.com/users/kuien/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-07T08:39:57Z","updated_at":"2016-01-07T08:39:58Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/greenplum-db/gpdb/pulls/247","html_url":"https://github.com/greenplum-db/gpdb/pull/247","diff_url":"https://github.com/greenplum-db/gpdb/pull/247.diff","patch_url":"https://github.com/greenplum-db/gpdb/pull/247.patch"},"body":"Functions can be declared with parameters with default values or\r\nexpressions.  The default expressions are used as parameter value\r\nif the parameter is not explicitly specified in a function call.\r\nAll parameters after a parameter with default value have to be\r\nparameters with default values as well.\r\n\r\nIt allows user to invoke a UDF without setting all the parameters.\r\nTwo examples to demo its usage:\r\n\r\n  CREATE FUNCTION dfunc1(text DEFAULT 'Hello', text DEFAULT 'World')\r\n    RETURNS text AS $$\r\n    SELECT $1 || ', ' || $2;\r\n    $$ LANGUAGE SQL;\r\n  SELECT dfunc1();  -- 'Hello, World'\r\n  SELECT dfunc1('Hi');  -- 'Hi, World'\r\n  SELECT dfunc1('Hi', 'Beijing');  -- 'Hi, Beijing'\r\n\r\n  CREATE FUNCTION dfunc2(id int4, t timestamp DEFAULT now())\r\n    RETURNS text AS $$\r\n    SELECT 'Time for id:' || $1 || ' is ' || $2;\r\n    $$ LANGUAGE SQL;\r\n  SELECT dfunc2(24);  -- 'Time for id:24 is 2016-01-07 14:38'\r\n\r\nNOTE: The default change set is ported from upstream, see original\r\ncommits below.\r\n\r\n  commit 517ae4039ebe12806d76adfd3bc1fc6578fc8862\r\n  Author: Tom Lane <tgl@sss.pgh.pa.us>\r\n  Date:   Thu Dec 18 18:20:35 2008 +0000\r\n\r\n  commit 455dffbb73f9875c39f2ab544420454168a8c68c\r\n  Author: Peter Eisentraut <peter_e@gmx.net>\r\n  Date:   Thu Dec 4 17:51:28 2008 +0000"},"comment":{"url":"https://api.github.com/repos/greenplum-db/gpdb/issues/comments/169598216","html_url":"https://github.com/greenplum-db/gpdb/pull/247#issuecomment-169598216","issue_url":"https://api.github.com/repos/greenplum-db/gpdb/issues/247","id":169598216,"user":{"login":"gpdbdreddbot","id":15618396,"avatar_url":"https://avatars.githubusercontent.com/u/15618396?v=3","gravatar_id":"","url":"https://api.github.com/users/gpdbdreddbot","html_url":"https://github.com/gpdbdreddbot","followers_url":"https://api.github.com/users/gpdbdreddbot/followers","following_url":"https://api.github.com/users/gpdbdreddbot/following{/other_user}","gists_url":"https://api.github.com/users/gpdbdreddbot/gists{/gist_id}","starred_url":"https://api.github.com/users/gpdbdreddbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gpdbdreddbot/subscriptions","organizations_url":"https://api.github.com/users/gpdbdreddbot/orgs","repos_url":"https://api.github.com/users/gpdbdreddbot/repos","events_url":"https://api.github.com/users/gpdbdreddbot/events{/privacy}","received_events_url":"https://api.github.com/users/gpdbdreddbot/received_events","type":"User","site_admin":false},"created_at":"2016-01-07T08:39:58Z","updated_at":"2016-01-07T08:39:58Z","body":"Hello kuien!\n\nThanks for submitting this pull request!\n\nAll pull request authors must have a Contributor License Agreement (CLA) on-file with us. Please sign the appropriate CLA ([individual](http://greenplum.org/contributor_agreements/GPDB_Pivotal_ICLA.pdf) or [corporate](http://greenplum.org/contributor_agreements/GPDB_Pivotal_CCLA.pdf)).\n\nWhen sending signed CLA please provide your github username in case of individual CLA or the list of github usernames that can make pull requests on behalf of your organization.\n\nIf you are confident that you're covered under a Corporate CLA, please make sure you've publicized your membership in the appropriate Github Org, per [these instructions](https://help.github.com/articles/publicizing-or-concealing-organization-membership/).\n"}}