Unix Technical Forum

BUG #2418: number & date & time

This is a discussion on BUG #2418: number & date & time within the pgsql Bugs forums, part of the PostgreSQL category; --> The following bug has been logged online: Bug reference: 2418 Logged by: James Email address: james@mercstudio.com PostgreSQL version: 8.1 ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Bugs

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 10:58 AM
James
 
Posts: n/a
Default BUG #2418: number & date & time


The following bug has been logged online:

Bug reference: 2418
Logged by: James
Email address: james@mercstudio.com
PostgreSQL version: 8.1
Operating system: Microsoft Windows XP Professional
Description: number & date & time
Details:

hi,

we would like to have convinience data conversion from datatype number of
value '' as null and datatype date / timestamp / timestampz of value '' as
null...

so far, postgresql will reject those value for number and date / time field
when it's empty string '' (as invalid date value or invalid number value)

it would be nice to have it auto converted

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 10:58 AM
Bruno Wolff III
 
Posts: n/a
Default Re: BUG #2418: number & date & time

On Tue, May 02, 2006 at 10:36:52 +0000,
James <james@mercstudio.com> wrote:
>
> we would like to have convinience data conversion from datatype number of
> value '' as null and datatype date / timestamp / timestampz of value '' as
> null...
>
> so far, postgresql will reject those value for number and date / time field
> when it's empty string '' (as invalid date value or invalid number value)
>
> it would be nice to have it auto converted


This isn't a bug and you should have asked this question on another list
(sql, general or novice would all be appropiate).
This isn't easy for you to do in Postgres as data validation is done before
before triggers activate.
I can think of a couple of things to do. One would be to change your app or
add a filter so that NULL is sent instead of ''. Another apporach would be
to read in the data as text with a function that converts the string to date
with the special feature of '' being converted to null. Your function should
be able to call the function used to input dates, so you don't need to do
a lot of hard work there. But depending on how you are inputting the data,
it may not be easy to make this fit an existing app.

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:21 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com