Documentation of maximum input string lengths

From: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Documentation of maximum input string lengths
Date: 2002-08-25 15:16:59
Message-ID: Pine.LNX.4.21.0208260105230.22485-100000@linuxworld.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,

I've just been thinking that the documentation doesn't cover the maximum
input string lengths for various data types well. Case in point, the
date/time code: there was a fair amount of discussion about validation
input, including checking for 'unreasonable' string lengths. Unless you
went and poked around the code, you couldn't know that the maximum string
length for a date/time string is 52 bytes.

So, the question is this: should there be documentation of the maximum
string length of a data structure so that application programmers can
provide string length validation? Perhaps MAXDATELEN and other static
values in adt/ should be put in pg_config.h so that the user does not need
to hard code them? Perhaps it is a bad idea, since programmers should also
do other validation, such as ensuring that a submitted date/time value
is what the program(mer) is expecting?

Gavin

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message sugita 2002-08-25 15:35:08 Re: Mac OS X: system shutdown prevents checkpoint
Previous Message Tom Lane 2002-08-25 14:57:12 Re: Are "text" strings 0 terminated internally?