Re: Date type in pl/pgsql function checking passed parameter

From: John DeSoi <desoi(at)pgedit(dot)com>
To: Partners Majolee Infotech <info(at)majolee(dot)info>
Cc: <pgsql-php(at)postgresql(dot)org>
Subject: Re: Date type in pl/pgsql function checking passed parameter
Date: 2005-10-24 14:11:00
Message-ID: 8CA9687B-D23E-4E5C-8C46-DC47965F5049@pgedit.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php


On Oct 24, 2005, at 9:02 AM, Partners Majolee Infotech wrote:

> We have a pl/pgsql function functionName(date) .. here if it has
> been called using functionName('23456') it gives error .. we need
> to raise an exception(customized error message) if the passed value
> is not date.. how can we do that.

You can add a function with the same name that accepts a text
parameter instead of a date. Then check the date and call your
functionName(date) function or raise your custom exception if the
date is invalid.

John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL

In response to

Browse pgsql-php by date

  From Date Subject
Next Message reiner peterke 2005-10-25 19:57:50 copy error
Previous Message Partners Majolee Infotech 2005-10-24 13:02:10 Date type in pl/pgsql function checking passed parameter