Unix Technical Forum

Binary input functions fail to enforce typmod

This is a discussion on Binary input functions fail to enforce typmod within the pgsql Hackers forums, part of the PostgreSQL category; --> Whilst working on the change I proposed to make domain types enforce their constraints inside the typinput/typreceive routines, I ...


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

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-11-2008, 04:48 AM
Tom Lane
 
Posts: n/a
Default Binary input functions fail to enforce typmod

Whilst working on the change I proposed to make domain types enforce
their constraints inside the typinput/typreceive routines, I realized
that there's a fairly serious flaw in the design of typreceive routines:
we don't pass them a typmod so they cannot enforce type-specific typmod
restrictions. This means for example that COPY FROM BINARY could insert
a more-than-four-character string into a char(4) column.

The correct solution of course is to include a typmod value in the
arguments passed to typreceive routines, and to adjust the receive
routines of those datatypes that use typmod to enforce the same
restrictions as the corresponding typinput routines do.

I think this is a "must fix" for 8.1.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

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 02:57 PM.


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