Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.9.3/8.9.3) with ESMTP id TAA27628 for ; Sat, 22 Apr 2000 19:09:29 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id TAA29203; Sat, 22 Apr 2000 19:09:22 -0400 (EDT) To: Jan Wieck cc: Peter Eisentraut , pgsql-sql@postgresql.org Subject: Re: TOAST (was: BLOB) In-reply-to: References: Comments: In-reply-to wieck@debis.com (Jan Wieck) message dated "Sat, 22 Apr 2000 22:44:52 +0200" Date: Sat, 22 Apr 2000 19:09:21 -0400 Message-ID: <29200.956444961@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200004/257 wieck@debis.com (Jan Wieck) writes: >> What I meant was that they'd still work, with a limit on field size, >> just like before. ie, no TOAST support. > Yes, but at the first time, a toasted value is handed to them > the result (up to backend crash) is unpredictable. So any > user defined function taking "text" as argument is > potentially in danger! Oh, right, user-defined functions on system types will have problems if the system type has been marked toastable. I was thinking of user-defined datatypes, for which it'd be OK to leave the type untoastable if you didn't want to fix the associated functions right away. > Better tell them they have to revise. Well, hmm. It's not out of the question that we could continue to support old user-defined functions even on toastable types. There is going to be a compatibility wrapper anyway around any function that's adhering to the old fmgr interface. So with just a little more work, we could make that wrapper expand any toasted values that are being presented to the function. Only new-style functions would ever get passed toasted values directly. This'd also make it a lot less painful to convert the built-in functions, of course. The only downside I see in this is that it'd take a few extra catalog lookups to determine which arguments are toastable types and thus potentially in need of untoasting. I don't think that'd be a big loss, since we normally only do the catalog lookups for a function reference once per query anyway. Seem reasonable? regards, tom lane