pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rob Sargent <robjsargent@gmail.com>
To: Jim Nasby <jim.nasby@gmail.com>
To: Ron Johnson <ronljohnsonjr@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Mimic ALIAS in Postgresql?
Date: Mon, 22 Jan 2024 16:38:20 -0700
Message-ID: <2b8d540e-d11c-4c4f-8389-d35833ba1cff@gmail.com> (raw)
In-Reply-To: <20dd517d-2b5c-49d2-aa9a-577baae1e175@gmail.com>
References: <CANzqJaCc5jVh3J3EA0j4Dz7V2HsrcR9eE0AE45pt-PmMrjhdmg@mail.gmail.com>
	<484b48cd-3a6e-4585-be9b-febed445e18b@gmail.com>
	<CANzqJaB-Ggo4ebO0vsPrEaFske7+e3viPRiBgnChxj5LN5j2PQ@mail.gmail.com>
	<b54e24c5-6869-4866-b01e-b44382a231e0@gmail.com>
	<7eed1809-2ed0-4a3d-a6f0-ed4ed55bd39c@gmail.com>
	<000c6cb5-94df-4c38-9b00-9e48c400c3e6@gmail.com>
	<20dd517d-2b5c-49d2-aa9a-577baae1e175@gmail.com>

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/.

view thread (19+ messages)  latest in thread

Message-ID: <2b8d540e-d11c-4c4f-8389-d35833ba1cff@gmail.com>
Permalink:  ../2b8d540e-d11c-4c4f-8389-d35833ba1cff@gmail.com/
Also on:    postgresql.org/message-id/2b8d540e-d11c-4c4f-8389-d35833ba1cff@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: robjsargent@gmail.com, jim.nasby@gmail.com, ronljohnsonjr@gmail.com
  Subject: Re: Mimic ALIAS in Postgresql?
  In-Reply-To: <2b8d540e-d11c-4c4f-8389-d35833ba1cff@gmail.com>
  References: <CANzqJaCc5jVh3J3EA0j4Dz7V2HsrcR9eE0AE45pt-PmMrjhdmg@mail.gmail.com> <484b48cd-3a6e-4585-be9b-febed445e18b@gmail.com> <CANzqJaB-Ggo4ebO0vsPrEaFske7+e3viPRiBgnChxj5LN5j2PQ@mail.gmail.com> <b54e24c5-6869-4866-b01e-b44382a231e0@gmail.com> <7eed1809-2ed0-4a3d-a6f0-ed4ed55bd39c@gmail.com> <000c6cb5-94df-4c38-9b00-9e48c400c3e6@gmail.com> <20dd517d-2b5c-49d2-aa9a-577baae1e175@gmail.com> <2b8d540e-d11c-4c4f-8389-d35833ba1cff@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox