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 1rnZ3K-00DvAd-ES for pgsql-sql@arkaria.postgresql.org; Fri, 22 Mar 2024 07:10:58 +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 1rnZ3I-000zbX-20 for pgsql-sql@arkaria.postgresql.org; Fri, 22 Mar 2024 07:10:56 +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 1rnZ3H-000zbO-Pv for pgsql-sql@lists.postgresql.org; Fri, 22 Mar 2024 07:10:56 +0000 Received: from mail-oa1-x2a.google.com ([2001:4860:4864:20::2a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rnZ3E-005o57-QM for pgsql-sql@lists.postgresql.org; Fri, 22 Mar 2024 07:10:55 +0000 Received: by mail-oa1-x2a.google.com with SMTP id 586e51a60fabf-229a90b7aa9so904632fac.1 for ; Fri, 22 Mar 2024 00:10:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711091453; x=1711696253; darn=lists.postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=RV7Xf3Vpq0UvnQYva/UvHCzzh9NrlCHfrA89nbvSoGs=; b=mi8ftjHEqpROnu4PknFa8G55DDeouwvdxdGv3ifj5oKuoku2oIc6d4Abq90mhNoXSe 8Bz1j9WTfMEsBcvuu9JngyIM37NwmHPEdGpuamN9yISSLSVEi1hBXPh3hW1ofh8kPsag Ca/Mcrgh+0MH22QDjy64eHEjSDKfX8g75s6k2mVRQlXSgTmr8E4H0sM0NC5iit9XAPtN hqhgqxUTyBY4DOT+8uQri2Rce+PDCdALFHQbWZfy7plkOxCOo+xpFOd2BpgfAYmu5a9Z HOOdImgpiF7QZV3CTQWIG88OKXRN81TGrC1uPXCfnB5CK80Flib/ixkjaoWShqrFw12T hbaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711091453; x=1711696253; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=RV7Xf3Vpq0UvnQYva/UvHCzzh9NrlCHfrA89nbvSoGs=; b=Lh3PyA/eYRviSlwZmWel+eSzmYUe/IipqXSsFjabY6pge0hWwTrRZLNLw25/uWB7cs +xjtJHq0Q545Tc0KVPpzHz3IB34NhWIXAPrxk34DDMjMsu2kS/n0+HAlr7yDUqGhS/K5 9MLxKFCFC5bbaQwxacdqITs790XmuGzqtC9LYQKVv43TfnsAj6tfQcJCMk5RIl++bzB/ GmurBm448hYmDSZgVV5meB43k/2HqAWTZRh5RU5lzgvyq0Ta/GMoFyLplDOYwFVyAfrW 0+QGvLUgESC+F0o6sX9hSK175XvKwrkSNkW7jT6TnLWh43srWpZ/TBIkA5PFH98I27hM duLQ== X-Gm-Message-State: AOJu0YxtC+gPWY0ON4/UqqoJoQD/z9jsC+UNX+X7ipPKbQVXtXMFTarw a/RluqqUqNrCTq5xmlPA50MDdziIGpqNC6MVDeGEmjOx73kTn6i19U1GFR/BQfdyfCEXGaqjtzx gWGnqfGE95cpJ6+Zdl3OV5YUqBxLtXtYlkf5GIDuT X-Google-Smtp-Source: AGHT+IHpCC7LShalvFZr2k4q5bqnEuv/vKNQB8x6s2UF2A7Jg9acpX0GRjqPIjOYmaPn/Ehg13jc1HdRjqldzltsMIQ= X-Received: by 2002:a05:6870:860a:b0:21e:8cc7:c7c8 with SMTP id h10-20020a056870860a00b0021e8cc7c7c8mr1519190oal.37.1711091452968; Fri, 22 Mar 2024 00:10:52 -0700 (PDT) MIME-Version: 1.0 From: intmail01 Date: Fri, 22 Mar 2024 10:11:23 +0300 Message-ID: Subject: How to choose table in SELECT clause without schema qualifier or 'set local' To: pgsql-sql@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000003b850e06143a86cd" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000003b850e06143a86cd Content-Type: text/plain; charset="UTF-8" Hi, My db have many schemas (company name) and there are SELECT code related to tables that I distribute for each company users. The structure inside are the same for all schemas. It is a nightmare to change code each time to modify the schema qualifier or SET LOCAL search_path when I add a new company. Is there command, configurations or any trick to not modify code each time I add company then code can works for any schema. Thanks. --0000000000003b850e06143a86cd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

My db have many schemas = (company name) and there are SELECT code related to tables that I distribut= e for each company users.

The structure inside are= the same for all schemas.

It is a nightmare to ch= ange code each time to modify the schema qualifier or SET LOCAL search_path= when I add a new company.
Is there command, configurations or an= y trick to not modify code each time I add company then code can works for = any schema.

Thanks.

--0000000000003b850e06143a86cd--