X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 37AB43A3F9C for ; Tue, 23 Nov 2004 16:43:38 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 17815-05 for ; Tue, 23 Nov 2004 16:43:33 +0000 (GMT) Received: from boutiquenumerique.com (boutiquenumerique.com [82.67.9.10]) by svr1.postgresql.org (Postfix) with ESMTP id 1ED043A3FAE for ; Tue, 23 Nov 2004 16:43:31 +0000 (GMT) Received: (qmail 9741 invoked from network); 23 Nov 2004 17:43:57 +0100 Received: from unknown (HELO musicbox) (boutiquenumerique-lists@192.168.0.2) by boutiquenumerique.com with SMTP; 23 Nov 2004 17:43:57 +0100 To: pgsql-performance@postgresql.org Subject: Re: Data type to use for primary key References: Message-ID: Date: Tue, 23 Nov 2004 17:45:27 +0100 From: =?iso-8859-15?Q?Pierre-Fr=E9d=E9ric_Caillaud?= Organization: =?iso-8859-15?Q?La_Boutique_Num=E9rique?= Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Opera M2/7.54 (Linux, build 751) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200411/354 X-Sequence-Number: 9308 > All, > Well, you should still escape any strings you're getting from a web > page so > you can ensure you're not subject to a SQL insert attack, even if you're > expecting integers. > Thanks, > Peter Darley Well, your framework should do this for you : "integer" specified in your database object class description "%d" appears in in your generated queries (or you put it in your hand written queries) => if the parameter is not an integer, an exception is thrown, then catched, then an error page is displayed... Or, just casting to int should throw an exception... Forms should be validated, but hidden parameters in links are OK imho to display an error page if they are incorrect, after all, if the user edits the get or post parameters, well...