pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: John DeSoi <desoi@pgedit.com>
To: Partners Majolee Infotech <info@majolee.info>
Cc: pgsql-php@postgresql.org
Subject: Re: Date type in pl/pgsql function checking passed parameter
Date: Mon, 24 Oct 2005 10:11:00 -0400
Message-ID: <8CA9687B-D23E-4E5C-8C46-DC47965F5049@pgedit.com> (raw)
In-Reply-To: <00a101c5d89b$296bfa80$0100a8c0@MI11>
References: <00a101c5d89b$296bfa80$0100a8c0@MI11>


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




view thread (2+ messages)

Message-ID: <8CA9687B-D23E-4E5C-8C46-DC47965F5049@pgedit.com>
Permalink:  ../8CA9687B-D23E-4E5C-8C46-DC47965F5049@pgedit.com/
Also on:    postgresql.org/message-id/8CA9687B-D23E-4E5C-8C46-DC47965F5049@pgedit.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: desoi@pgedit.com, info@majolee.info
  Subject: Re: Date type in pl/pgsql function checking passed parameter
  In-Reply-To: <8CA9687B-D23E-4E5C-8C46-DC47965F5049@pgedit.com>
  References: <00a101c5d89b$296bfa80$0100a8c0@MI11> <8CA9687B-D23E-4E5C-8C46-DC47965F5049@pgedit.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox