adding a C function with optional arguments - Mailing list pgsql-general

From Jim Mercer
Subject adding a C function with optional arguments
Date
Msg-id 20001214153901.K11043@pneumonoultramicroscopicsilicovolcanoconiosis.ca
Whole thread Raw
Responses Re: adding a C function with optional arguments  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
i've poked about and made a new function "makecrypt(plainpass, salt)", and
it works ok.

basically, it is just a hook to the unix crypt() function.

i was wondering if someone could tell me how, if possible, to implement
a c function such that i can do:

> SELECT makecrypt('secret', 'salt');
or
> SELECT makecrypt('secret');

such that if salt is not specified, the c function would make one up.

--
[ Jim Mercer          jim@pneumonoultramicroscopicsilicovolcanoconiosis.ca ]
[          Reptilian Research -- Longer Life through Colder Blood          ]
[ aka                        jim@reptiles.org              +1 416 410-5633 ]

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: create trigger (can't compile example, problem with include files)
Next
From: "Dan Wilson"
Date:
Subject: Re: Trigger/Function problem