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 1tryFw-00CmPB-9b for pgsql-bugs@arkaria.postgresql.org; Tue, 11 Mar 2025 11:58: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 1tryFu-00EpgD-O8 for pgsql-bugs@arkaria.postgresql.org; Tue, 11 Mar 2025 11:58:42 +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 1tryFu-00EpbI-EG for pgsql-bugs@lists.postgresql.org; Tue, 11 Mar 2025 11:58:42 +0000 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tryFs-002Dk9-0e for pgsql-bugs@lists.postgresql.org; Tue, 11 Mar 2025 11:58:41 +0000 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-3914bc3e01aso1081744f8f.2 for ; Tue, 11 Mar 2025 04:58:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1741694318; x=1742299118; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=b5UtJVsRQzYREt1ABT/jh4YZ8AjG6XRLvzbszWpyEbo=; b=oyqEGNLw/sX62VPDJw1xXxAPe4nEonEt1rMt8W/GPB3+JhAqNFADwFQVe4AnRWtHFP tkKMoQafVYS1MJslK+dBw0oHGvABKRT5AXUevbHayC9M7Zf225SfDmoQodhw5YFlt5lU HYUGIjHyXY6KgOsKlHTUwqS55GTykD+PY2ISjrSbHFtvv7Jl6ftbEfL+FZvI0tSNZHRS Zvl61S/kZ3irSwLS8XTxKFq2duf/+dOhVanfIvrq73ftLjvV4CrmftLtJZUQf9EpzC1T dnuyrgiVngC4pn3cKgw4QGo316stxvqo+PUurvSTLYa1TOdZvnWn5fxiNXjafHCN7Opx NqSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741694318; x=1742299118; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=b5UtJVsRQzYREt1ABT/jh4YZ8AjG6XRLvzbszWpyEbo=; b=kkBlr/yVwIc2uAje8QbJrkNQG4n+Qdnk3AiOzDPv9JJTzrnSy3mWmJGdCL1t2PmJKr LTq1llksVHwsnzIAMrOzYz+xJOi6lpWHhgqY1NVdwW8Hg6ZDrhS2geUwi87bZWFOQvhI Q++Ke+ANWxCNs7K5UGPay2MCMa30LHZ5htz1E2fFmOH00OsY4QaDZcttcbsdgPJDSHhj GNejL3JzXvzZZ+NgHi58emHuv3XAtHitEmkyjFGWspTR5Lo0Pb5sYlGMlBB+6oiLXKL2 Gls/eQzV15Yj0y2hpgxbR/gGHOdlWwXTDqBhR1JA0b8mpc5J3sTtnn/gEaSkQrvEfwzq d8SQ== X-Forwarded-Encrypted: i=1; AJvYcCU72IMKiO6YEJ3acbqgIE5cqFwDRteMzFgs7XnzzYpZRX57wJpyed1KTpoVAw8CAqK+YuOYgVUSL2Y/@lists.postgresql.org X-Gm-Message-State: AOJu0YzFthBOWWdPuDSJYvtI7ZDuE37RDCuiTEPjtaUjut9t2kgHH50W VLosXQJyySfUHrklgrAHWloYQirFYC8kgD27koi/pbjCGh1N0j9Z4FIk3Ydu1rcqXojWHXjgHB/ a X-Gm-Gg: ASbGncvCJNyaDu9bU9xzwOTIRKHQG3vyS4zOlxQcL0hpiZ+AvnoRk30N7s816kVTIOG mIcJKqV1oQ4bPQIrFxXooJEBGqNtGrYyM5rhF5MtN9O9zc3kFHN/y3OQBQhV3YQq2n5Pis2vIpT rns8yc93rJzdyaCcA++H+IcwCNx3RWjXpvQitReihqayWQwYUsa2cLs56pVASUctOpJ62fvvkj2 ehRJJSDmMWxZf0QJ6aXJ5LZHCSpDkvL/1P3cr6alPksxbdODZAZ/u65nBUs5Tei9PToY6pFKO+g NeGf33tqrM2+BpYA8WQVSQfJh8QYUqQU2VhYu7Zwrs5i9Pmz9DQbY8KaCqyQnh2Iag== X-Google-Smtp-Source: AGHT+IFLa7cHH7xPKegTBssbw/feU7U2gU3HKQZzcplzNJCGf56lD8nP4nB0L3x8WgXWxmM+EQ/o4w== X-Received: by 2002:a05:6000:2ac:b0:390:f460:77b0 with SMTP id ffacd0b85a97d-39132d3805cmr14083347f8f.26.1741694318105; Tue, 11 Mar 2025 04:58:38 -0700 (PDT) Received: from localhost.localdomain ([2001:871:5e:6786:359d:cbd0:7d31:ec13]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43ceeb5995esm96721655e9.16.2025.03.11.04.58.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Mar 2025 04:58:37 -0700 (PDT) Message-ID: Subject: Re: Unqualified name not resolved in function called from materialized view (17.4) From: Laurenz Albe To: Peter Wright , pgsql-bugs@lists.postgresql.org Date: Tue, 11 Mar 2025 12:58:37 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.54.3 (3.54.3-1.fc41) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 2025-03-11 at 19:45 +1100, Peter Wright wrote: > PostgreSQL version: 17.4 > Operating system: Ubuntu 24.04, x86_64, kernel 6.8.0-51-generic > Description: >=20 > Given a file "break_it.sql" containing this SQL: >=20 > SELECT version(); > CREATE VIEW things AS SELECT 1 AS id, 'rock' AS thing_name; > CREATE FUNCTION num_things() RETURNS INTEGER AS $$ SELECT COUNT(1) FROM= things; $$ LANGUAGE SQL STABLE; > CREATE MATERIALIZED VIEW thing_report AS SELECT num_things() AS number_= of_things; >=20 > Running the following commands with the environment pointing at a Postgre= SQL 17.4 server: >=20 > psql:break_it.sql:4: ERROR: relation "things" does not exist > LINE 1: SELECT COUNT(1) FROM things; > ^ > QUERY: SELECT COUNT(1) FROM things; > CONTEXT: SQL function "num_things" during inlining >=20 >=20 > Running the same commands with the environment pointing at a PostgreSQL 1= 6.8 > server does *not* report an error That is not a bug, it is intentional. See the first entry in the list of incompatibilities https://www.postgresql.org/docs/current/release-17.html#RELEASE-17-MIGRATIO= N You should fix the function. Yours, Laurenz Albe