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

From Tom Lane
Subject Re: adding a C function with optional arguments
Date
Msg-id 10063.976854571@sss.pgh.pa.us
Whole thread Raw
In response to adding a C function with optional arguments  (Jim Mercer <jim@pneumonoultramicroscopicsilicovolcanoconiosis.ca>)
List pgsql-general
Jim Mercer <jim@pneumonoultramicroscopicsilicovolcanoconiosis.ca> writes:
> 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.

This would be two separate functions in Postgres' view of the world.
Whether one calls the other internally is between you and your code...

            regards, tom lane

PS: pneumonoultramicroscopicsilicovolcanoconiosis?  Wazzat?

pgsql-general by date:

Previous
From: "Dan Wilson"
Date:
Subject: Re: Trigger/Function problem
Next
From: Maarten Boekhold
Date:
Subject: RE: Postgres failover implementation