Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rRydZ-00AZPL-Fo for pgsql-general@arkaria.postgresql.org; Mon, 22 Jan 2024 18:03:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rRydY-006Aoy-4P for pgsql-general@arkaria.postgresql.org; Mon, 22 Jan 2024 18:03:08 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rRyaK-0064iM-Em for pgsql-general@lists.postgresql.org; Mon, 22 Jan 2024 17:59:48 +0000 Received: from mail-oa1-x2b.google.com ([2001:4860:4864:20::2b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rRyaH-002pZF-Up for pgsql-general@lists.postgresql.org; Mon, 22 Jan 2024 17:59:47 +0000 Received: by mail-oa1-x2b.google.com with SMTP id 586e51a60fabf-2046b2cd2d3so2657405fac.0 for ; Mon, 22 Jan 2024 09:59:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705946385; x=1706551185; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=12eOR6wKf9cSSdPX6ffBBTbMh0pRtszZ55jOww1NtAE=; b=UEe/YFL/5x4J0K9Ev4H3eQqc7GpCvgJaL29LxFE3jEYT9aTNAY4lAZJqx4YmlU2w2o qXN0WGZvzxKGt661ALXI3PvVdTgxx3AXJbUqU1UVA4dVovEG9S2gEyUG8m0oWt3reb1P IXSPOeiDMT7ImoZ77byP9ATfGPjCNd5viyQs0+WaBrODckToTg/uwHdaft2dy9csI7MK zisNrHdpjJGG0pRxZf6/ndftcjvY6mtKe7g4Bz3MpW3zuHCxRWxeYcKnvCJ3GkdO7OkG BkSoz2ruNcdDHxASvFLDz8KO5jes/E7HJz5OyounWW82fSVzEwbe9tZ/nw7a7DLbS/fx LZvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705946385; x=1706551185; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=12eOR6wKf9cSSdPX6ffBBTbMh0pRtszZ55jOww1NtAE=; b=r84zcGjrpRacodHnJJ/tMogGlFr+TjXxdXCaTbKVbAIfI3Cr/TC5qT7yZCTkvZmVK5 ycFDVG02Kh7QNJy9F1QHVMx2gHxwAxK1gKg4euZAF74iIHPOIxFhBnK++RAAlrsU4TQn ZDUIPKqJ+wccBt/Wz7a04UaeffAYbhWyuxHeVFH1O1wUxgcrg/QP+Fd4tQojX8x7GUM/ g30z4vJVndVi0adpvISQj5XSkwPoNaqMzXGzcQ4iivniSwvZinOsUR+HCtIAI+rUXBpu 2fIJTHWIIzAhPkBDejbZ7anP89N0oOM7JdouB0g7n1imaKgXS2czG3lQhu3v53ATwTp4 njIg== X-Gm-Message-State: AOJu0Yy6I33FL/efN1j/S+veoNckcLLOTve3DpBM61ViuiimPwFuaEIM qLVMAuEh0Tzb5GZXQZ/uRY7eQVhTH8kP+sVFm25vaOdVvNINfyCF8Chrjyo= X-Google-Smtp-Source: AGHT+IHNa3PLHRBCKxS4xhLIi7RMpZWXuDWCsHnKzttvx6flAOEKurDOuhS1ENOrG5ZAhba1Bm59fA== X-Received: by 2002:a05:6870:c084:b0:210:a49b:8ed0 with SMTP id c4-20020a056870c08400b00210a49b8ed0mr254124oad.117.1705946385090; Mon, 22 Jan 2024 09:59:45 -0800 (PST) Received: from [192.168.2.3] (070-113-014-216.res.spectrum.com. [70.113.14.216]) by smtp.gmail.com with ESMTPSA id qa12-20020a056871e70c00b00210d2c251cbsm1831623oac.39.2024.01.22.09.59.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 22 Jan 2024 09:59:44 -0800 (PST) Message-ID: <20dd517d-2b5c-49d2-aa9a-577baae1e175@gmail.com> Date: Wed, 17 Jan 2024 17:25:14 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Mimic ALIAS in Postgresql? Content-Language: en-US To: Rob Sargent , Ron Johnson Cc: pgsql-general@lists.postgresql.org References: <484b48cd-3a6e-4585-be9b-febed445e18b@gmail.com> <7eed1809-2ed0-4a3d-a6f0-ed4ed55bd39c@gmail.com> <000c6cb5-94df-4c38-9b00-9e48c400c3e6@gmail.com> From: Jim Nasby In-Reply-To: <000c6cb5-94df-4c38-9b00-9e48c400c3e6@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 1/16/24 6:41 PM, Rob Sargent wrote: > On 1/16/24 17:39, Jim Nasby wrote: >> On 1/16/24 4:57 PM, Rob Sargent wrote: >>>>     Or perhaps you have to beef the sed up to use word boundaries just >>>>     in case. >>>> >>>> >>>> I'm not a Java web developer... 😁 >>> >>> You need to adjust you glasses if that's what you see me as. >> >> Reality is that basically all modern (as in last 20 years) SQL access >> is via frameworks that all use their own language and come up with SQL >> based on that. How hard it'd be to bulk change the schema depends >> entirely on the framework. > Hm, it's a string /somewhere/.  The rest of this thread might be accused > of adding to the problem. No, it's not, at least not as a complete SQL statement. See [1] as an example of how this works in Ruby on Rails. Most modern frameworks work in a similar fashion: you DON'T write raw SQL, or anything that looks anything like it. In fact, many (most?) of these frameworks make it difficult to do anything in raw SQL because it completely breaks the paradigm of the framework. Note that I'm talking about *frameworks*, not languages. But since most languages require huge amounts of boilerplate to create a web service or website it's not surprising that pretty much everyone uses frameworks. (Go is actually an interesting exception to this.) 1: https://guides.rubyonrails.org/active_record_querying.html#find -- Jim Nasby, Data Architect, Austin TX