Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jZvj6-0005Ty-BV for pgsql-general@arkaria.postgresql.org; Sat, 16 May 2020 12:15:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jZvj4-0006IB-RC for pgsql-general@arkaria.postgresql.org; Sat, 16 May 2020 12:15:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jZvj4-0006Gk-HM for pgsql-general@lists.postgresql.org; Sat, 16 May 2020 12:15:34 +0000 Received: from mail-io1-xd42.google.com ([2607:f8b0:4864:20::d42]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jZviv-0000NQ-NP for pgsql-general@lists.postgresql.org; Sat, 16 May 2020 12:15:31 +0000 Received: by mail-io1-xd42.google.com with SMTP id w25so5473444iol.12 for ; Sat, 16 May 2020 05:15:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=iCmoqHCijet//WlYAZHs7fSk3m7bEblNiY7xidq+xik=; b=sW7ClPOGPVZggOtdpE1nv5FRJbfH+KuSH5lMJEKUrQmR/j/UVhp5HcplNcTPRYi4jm p8+Z0orbMJVIoh1nZ++REFtPYzKG+h5I+tdKLuJaE/egsM66bKHtj3I89tS1sBtUrEd0 3VvPwW05W45O1AUu1b3TA7DEhfrVPf/iznUk0bPLr+WI7nzjfSlNvZWOIA0IU6g4Rva/ ZZSBfyGONnaBElll8K23j4nR/CZNWFfTEBclupiX48rkHR3I3/aOVL8p/BL0tYxMWeAD YaWJVZZWu/nNXnEErkFytFfltAWNRbCrk8GIwp4Lx7gw+/eLNlHWc9XlrshOjz9nZ05a yspA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=iCmoqHCijet//WlYAZHs7fSk3m7bEblNiY7xidq+xik=; b=ET51syDrzhvXu0KcIHN8hRvuhPnixY24JLgWFgfNsNLfyFmQNMbCTfHg34kYlF/s3W mWUe2C4wYOnwWAv0gMutWMRzfZm2xoH0D7zPw8B6l4RIZ19OJwYjyP6pA09Ts6t5yp4w azBRReLuuw2g2bD+I2+NP4Foy3gZz8CLT8dDzEXRVbkjpSQqIahyClrS2haBxIm1alfc lsLY4pgDt3IUibHRDFTfOINzyJKY8j7K8TZHehI4h+dZNxAA7BVwkgRW2uUfkeGYrzpR 9XocYpZ+sErgMmTZpm9g5kppCww8SU5kh2rdel2Z2n/QTS2pMRQWyE4rHSq5cGNMl9if YcUw== X-Gm-Message-State: AOAM532tYy6c75BruVTLnQ76sWtU6AIjtCMG6FQVU880hhkOUK4uyIAO eoB6casdxwBJdzSoTdSrZtI= X-Google-Smtp-Source: ABdhPJypWV845KG3sXdJ6QiQPiWivNxvRSp5wj9d0MUWcmHaLr//yzVGsKvstmym/zcLuzY3OnaV0w== X-Received: by 2002:a6b:902:: with SMTP id t2mr6960110ioi.153.1589631323396; Sat, 16 May 2020 05:15:23 -0700 (PDT) Received: from [192.168.1.144] (c-73-63-59-118.hsd1.ut.comcast.net. [73.63.59.118]) by smtp.gmail.com with ESMTPSA id u17sm2117863ilb.86.2020.05.16.05.15.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 16 May 2020 05:15:23 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Rob Sargent Mime-Version: 1.0 (1.0) Subject: Re: schema agnostic functions in language sql Date: Sat, 16 May 2020 06:15:22 -0600 Message-Id: <01AD9083-259E-4F92-85E8-8A254E89716C@gmail.com> References: <19492.1589587436@sss.pgh.pa.us> Cc: "David G. Johnston" , Adrian Klaver , "pgsql-generallists.postgresql.org" In-Reply-To: <19492.1589587436@sss.pgh.pa.us> To: Tom Lane X-Mailer: iPhone Mail (17E262) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > On May 15, 2020, at 6:03 PM, Tom Lane wrote: >=20 > =EF=BB=BFRob Sargent writes: >> I cannot create a plain sql function unless the search_path covers any=20= >> table mentioned. Not the case when using plpgsql - no path needed. >=20 > Oh, one of the things that's quite a lot different is the checking > applied at function creation time ;-). >=20 > For a SQL function, by default we'll try to parse and analyze the body, so= > any unknown tables will draw an error. plpgsql doesn't go further than a > very crude syntax check. >=20 > If you don't like that, you can set check_function_bodies =3D off while > creating your SQL functions. But in any case, it's only related to what > happens at execution if the search path is the same. >=20 > regards, tom lane And my fundamental error was thinking the parse of all create function calls= was not language specific beyond syntax. Looking back, my use of sql functi= ons has been for inline-able calculations reused in other plpgsql functions.= =20 check_function_body=3Doff may be what I want during the site install as the d= efinitions should be correct in all aspects.=20 Thank you all rjs=