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 1tCJm0-00GIcx-4N for pgsql-hackers@arkaria.postgresql.org; Sat, 16 Nov 2024 14:27:39 +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 1tCJlw-00ESnQ-W7 for pgsql-hackers@arkaria.postgresql.org; Sat, 16 Nov 2024 14:27:37 +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 <9erthalion6@gmail.com>) id 1tCJlw-00ESnH-Kv for pgsql-hackers@lists.postgresql.org; Sat, 16 Nov 2024 14:27:37 +0000 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from <9erthalion6@gmail.com>) id 1tCJlt-002GXL-Nu for pgsql-hackers@lists.postgresql.org; Sat, 16 Nov 2024 14:27:36 +0000 Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-a9a0ef5179dso516623666b.1 for ; Sat, 16 Nov 2024 06:27:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731767253; x=1732372053; darn=lists.postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=g9P4M32nwf+vZV69BYirJAW1XYZxKg0tFrQzjT5upuo=; b=MPWuOsYAuFrTDbdhbA5p5TXPRAPHoTADDSbBS2y9OpjLJtNCOSZmsMC6P5UDvTA+Zy BlQWpFx1Fsv9Thvu4jM2N3W3DNXSPnEUyDwvZ8KbBCJiq7n0zub7CpOPh/24tuqOG/cy N1uVG4gMAIYs87mZPHN2d5jYF55SKw3kd+ybqK88YRbeH763cPRsnGaVFE2LtCC+RFxD Ro0BHS9dKIGDMLruYD6ujuhCkjOmK2m+diFEqSXvns5AqXTSoQsnOostYDAphHtkISAm uulp+22mnXJ4EUPBdU1N6iDWYQML6734+9WRoxFMXGZxM51SVClV6NvqDyB4FCEYWorc Wmig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731767253; x=1732372053; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=g9P4M32nwf+vZV69BYirJAW1XYZxKg0tFrQzjT5upuo=; b=BtHnclvUZOXNCpv+WazaMg+4TyHiauIuPb0GTE3su3xMkfK1X2XfDu/xXGcKsCTASf EwnyG9BPPuzYwkItc3p7qdkalSRL1KA3ym00aV3SvS9clAEjNXdzZCdJkwlFfwHMMCGB 3RUXh5EJp5EB3SoeDxR0XmnDNCYNaBwSY/9hxivYMyCSwuuh74u08Aiq1qXDpQAT37LO QX5JLM55V66IF/KlceakJU2KREPJ2B03fQkg56lkrX8jEuctP9MPg1f/GvtCSuqwTTtl ZX5S1YUAslDrfMqHacQPG6ti8EXz+yy/+X9waF6xPB2DtK6CtF1VKTpwbcFt9sK7btlB 9hLA== X-Forwarded-Encrypted: i=1; AJvYcCW2nMC9/HDIw94j1OmbwJ0nukkR9/qPGU9iG7YDieUTfEd2f6LJjDwPoYYauwZbKNE+LVxfOo8pyPu9oMqA@lists.postgresql.org X-Gm-Message-State: AOJu0YzY/n6rm8OSrN74XWv3FtY+zDdj+ZlFUsl0+lTCeYTYkUKiXRqR vQIZL34ktq0O3b2oBB4yF7/DUTdenDcSCGsXLQRq80Ets3o+3O2K X-Google-Smtp-Source: AGHT+IFYu+u9VZ5M8hiX2yhubd0RRvwEpFDW1UIxjRRGco12DD3UhW8A6fPNMW5QRXGZDbBLSREcZQ== X-Received: by 2002:a17:906:d108:b0:aa4:844d:e5ee with SMTP id a640c23a62f3a-aa4844dfe9fmr478999566b.56.1731767253229; Sat, 16 Nov 2024 06:27:33 -0800 (PST) Received: from ddolgov-thinkpadt14sgen1.rmtde.csb (dslb-178-005-232-220.178.005.pools.vodafone-ip.de. [178.5.232.220]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aa20df568f5sm311369466b.70.2024.11.16.06.27.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Nov 2024 06:27:32 -0800 (PST) Date: Sat, 16 Nov 2024 15:27:30 +0100 From: Dmitry Dolgov <9erthalion6@gmail.com> To: Pavel Stehule Cc: Laurenz Albe , Erik Rijkers , Michael Paquier , Amit Kapila , DUVAL REMI , PostgreSQL Hackers Subject: Re: proposal: schema variables Message-ID: References: <3chredgnjcmccym2kczawfih226b4ac6co7p6z4jeofevrcosi@mrsxkx2x2c65> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Sat, Nov 16, 2024 at 07:10:31AM GMT, Pavel Stehule wrote: Sorry, got distracted. Let me try to answer step by step. > > As far as I recall, last time this topic was discussed in hackers, two > > options were proposed: the one with VARIABLE(name), what you mention > > here; and another one with adding variables to the FROM clause. The > > VARIABLE(...) syntax didn't get much negative feedback, so I guess why > > not -- if you find it fitting, it would be interesting to see the > > implementation. > > > > I'm afraid it should not be just an alternative syntax, but the only one > > allowed, because otherwise I don't see how scenarious like "drop a > > column with the same name" could be avoided. As in the previous thread: > > > > -- we've got a variable b at the same time > > SELECT a, b FROM table1; > > > > I am sorry, but I am in very strong opposition against this idea. Nobody > did reply to my questions, that can change my opinion.