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 1rS3uF-00B8eJ-TP for pgsql-general@arkaria.postgresql.org; Mon, 22 Jan 2024 23:40:44 +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 1rS3uE-007h3b-T7 for pgsql-general@arkaria.postgresql.org; Mon, 22 Jan 2024 23:40:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rS3uE-007h3R-EF for pgsql-general@lists.postgresql.org; Mon, 22 Jan 2024 23:40:42 +0000 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rS3u7-003CU2-8O for pgsql-general@lists.postgresql.org; Mon, 22 Jan 2024 23:40:41 +0000 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-6dbd07916d0so2189542b3a.0 for ; Mon, 22 Jan 2024 15:40:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705966833; x=1706571633; darn=lists.postgresql.org; h=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=eEbJe7tSH6HjbVljkmAYZRN/QAEWzObwsDaxqVkbCmo=; b=KwqlNwR4bSqWPbl+Yi8vimiKcII7KbS+J4rGYrsdBalGYZStMIxFgHEpsQn8Nv5i0O Ev/YHVh6AVAcpTKkQvBoXI1OspqFBsBnqDn+4bJ/NTU4PRN5aaN5g9xksI6+E9Tg0lZj lSgxDxxbEPM9jDpfpRbMfB3SNi3ccdzs7qqcdEU8I/wj9UfHToCU5xlg7Hb2oMAqA1Gd xaMAiypQZUTlDMeuAF60ObeaziIss1Niv7Imrr64bHCO1fJL0fb4VXTonckkGUF/KlXw hgjLPmsasIxnplMJ3d9bZqzugay4uzQRx4pbsRNUJG/OdmXcUelRPzi6v4kYK/LdJPQG VMbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705966833; x=1706571633; h=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=eEbJe7tSH6HjbVljkmAYZRN/QAEWzObwsDaxqVkbCmo=; b=OVieyUNXqkEiJN+DcpkfHn8xV+Hzy7v5ZComgL6hT+MXknnIPOQFfvCmfjpnHr0uhX F37u2kLyr25CZ1Z3wmU7T/VYZhyWGekk7VgKo/YXbAPAyT1GHkKEC00yyUkfFAozmJs2 0QyKfyiWUQvWhj9Qhj2pDWSEQLdKQElJn+A/LgHwf9xqzFERaw8soqB8vzt+O+20gbj5 zIM4+UJAHgUzLi1tbHfYoYoyn3beNrvTaO6y8Xu5KvWXL0/2817ydGgQQh+MwZxy6Q7Y mm+KnoHcvv6bEr+gtra0Zr0sy5e6qGf0jzgjEQ+iITyZU/JnYTLOHfah/tdQEyGxhc2t m3gQ== X-Gm-Message-State: AOJu0YyNrFqzKKO8TaOCIqTiJ7cqMdeM8AODVXv96QYkCy6+8w4Ujo0u fK+rl8efgWvynRU59T7/RgDiaRL/zKvN7R2RrHKNMlQ1+7LnC8OB X-Google-Smtp-Source: AGHT+IGH7POg4631eGPTUZdmtxJpSMw4ow467+3vMfsJCRPQnkxoQ6yDGU3r1/X8iv4HiYkm0RIZyg== X-Received: by 2002:a05:6a00:1888:b0:6db:e4f6:70c7 with SMTP id x8-20020a056a00188800b006dbe4f670c7mr2407906pfh.62.1705966832792; Mon, 22 Jan 2024 15:40:32 -0800 (PST) Received: from [192.168.1.3] (c-76-140-27-218.hsd1.ut.comcast.net. [76.140.27.218]) by smtp.gmail.com with ESMTPSA id y74-20020a62ce4d000000b006d9a48882f7sm10569985pfg.118.2024.01.22.15.40.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 22 Jan 2024 15:40:32 -0800 (PST) Content-Type: multipart/alternative; boundary="------------UlRtfbjXtfXsY6LGkOw9SFfj" Message-ID: <2b8d540e-d11c-4c4f-8389-d35833ba1cff@gmail.com> Date: Mon, 22 Jan 2024 16:38:20 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Mimic ALIAS in Postgresql? Content-Language: en-CA To: Jim Nasby , 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> <20dd517d-2b5c-49d2-aa9a-577baae1e175@gmail.com> From: Rob Sargent In-Reply-To: <20dd517d-2b5c-49d2-aa9a-577baae1e175@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------UlRtfbjXtfXsY6LGkOw9SFfj Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 1/17/24 16:25, Jim Nasby wrote: > 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 You may well be correct, but I have to ask the OP (Ron) if this is the case in the current situation.  I find it difficult to conceive of a "framework" apparently arbitrarily flipping between the alias and the base name. (I read "For example, sometimes" as arbitrarily.)  The few database frameworks with which I'm familiar would tolerate the coder using either name.  And indeed in those (hibernate, mybatis, jOOQ) the coder would be the one choosing the /nom du jour/. --------------UlRtfbjXtfXsY6LGkOw9SFfj Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On 1/17/24 16:25, Jim Nasby wrote:
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
You may well be correct, but I have to ask the OP (Ron) if this is the case in the current situation.  I find it difficult to conceive of a "framework" apparently arbitrarily flipping between the alias and the base name. (I read "For example, sometimes" as arbitrarily.)  The few database frameworks with which I'm familiar would tolerate the coder using either name.  And indeed in those (hibernate, mybatis, jOOQ) the coder would be the one choosing the /nom du jour/. 
--------------UlRtfbjXtfXsY6LGkOw9SFfj--