Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kryTC-0007bB-0y for pgsql-general@arkaria.postgresql.org; Wed, 23 Dec 2020 07:22:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kryTA-0001uR-0c for pgsql-general@arkaria.postgresql.org; Wed, 23 Dec 2020 07:22:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kryT9-0001tb-L6 for pgsql-general@lists.postgresql.org; Wed, 23 Dec 2020 07:21:59 +0000 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kryT7-00022b-2v for pgsql-general@postgresql.org; Wed, 23 Dec 2020 07:21:59 +0000 Received: by mail-ed1-x532.google.com with SMTP id b73so15266629edf.13 for ; Tue, 22 Dec 2020 23:21:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=ZycSl46m0MIYs7/5yC7OdP2Dv7yPkWT7vAXL5i5PYLE=; b=zSxJuG5qlxnwlhSPPaLyOimycG/IMyBSzrreXeF6CiHjcHL2Xfv5FRAdnU3gerEONQ uMicoOp9QXIwAtRUXk+kAtEEbvxBq6RO/NhlXzD1D2fwpjlpwm3EBorR2E05Eq85pq6J QqV2R7bXYfKN9gjAmcYaKhcUSysnCKVbcOdul0QqMUK9Goh0AIn0YC+W4vepD9/szY+W RvY9AOUFf0aNRr/wpl8Z1KOVdJXQPcxg9d9Yh7ElVimjMiPKA/f1lEvLDFRU9uZ6RsqM YqRECOGXT2CGejg6gIFck+Nb2qqqitsiMrhIqMpA9rI7rgcehtcX+iSNO3ozxkFyUbMj OC4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=ZycSl46m0MIYs7/5yC7OdP2Dv7yPkWT7vAXL5i5PYLE=; b=lIjF9UNV9gkknFERpbZZAuaHcUdPpkXuXozZeJ8GnmranNdqHndueadejhSUYCD0hZ jv2bIUDJoC96C5GwaUaMQ0fxVvJdBGnzkhwbJh3EC/VIWvhUHdTkuj8NCIVLu5eZfVKJ OFmm7cfflbazUYypGHKuXPCLZBfSD3RkK3MqulgYgthIO7lz9mepk1mW0mneG0QGw7my r1la08wEm06kwiDaR+MlSDEphG5wCpaUIubkADZpMSBiEz6OVxXEOOEEzG1qGJLb3Fog tcIEr5ZWDPd1c8xnGVAHTcPsxLfdAIbDx7OK1sgdgLr5XKhVJsmM17wVPjv//cveFbhG MJ6A== X-Gm-Message-State: AOAM533XJjbw40xoggsadK5M4eRQxTzO9oVlTGhYiUG/ms5I667cNqjD Z3hqGLn8s4P1bc1L/yTwGY6/RvcIJdU+nA== X-Google-Smtp-Source: ABdhPJw7KeVFwmDnLkS+ZZjHAHUThCjpvtwYmAmwj938kKQ1V2MtvHxHiJVnvCwl6pkQqQ0lZXhNUw== X-Received: by 2002:a50:f299:: with SMTP id f25mr23325193edm.133.1608708115342; Tue, 22 Dec 2020 23:21:55 -0800 (PST) Received: from localhost.localdomain (217-149-172-5.nat.highway.telekom.at. [217.149.172.5]) by smtp.gmail.com with ESMTPSA id s1sm11365614ejx.25.2020.12.22.23.21.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Dec 2020 23:21:54 -0800 (PST) Message-ID: <612fdeaf511c9eca2ccfff50e605461213890604.camel@cybertec.at> Subject: Re: Information schema sql_identifier From: Laurenz Albe To: Adrian Klaver , pgsql-general Date: Wed, 23 Dec 2020 08:21:54 +0100 In-Reply-To: <653c81a9-bc2b-e7a6-1ece-eab59f007400@aklaver.com> References: <653c81a9-bc2b-e7a6-1ece-eab59f007400@aklaver.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, 2020-12-22 at 16:07 -0800, Adrian Klaver wrote: > This came up in this SO question: > > https://stackoverflow.com/questions/65416748/postgres-12-4-gives-function-does-not-exists-error > > Where the query is: > > SELECT (TABLE_SCHEMA || '"."' || TABLE_NAME) as table_name, > pg_size_pretty(pg_table_size(table_name)) as table_size, > pg_size_pretty(pg_indexes_size(table_name)) AS indexes_size, > pg_size_pretty(pg_total_relation_size(table_name)) as total_size > from information_schema.TABLES nowait > where TABLE_SCHEMA='myschema' > order by pg_total_relation_size(table_name) desc; > > And the error is: > > "ERROR: function pg_table_size(information_schema.sql_identifier) does not exist > LINE 1: ..."."' || TABLE_NAME) as table_name, pg_size_pretty(pg_table_s..." I don't see the problem. Cast "table_name" and "table_schema" to "text" wherever it occurs. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com