Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hcsMb-0003yR-1L for pgsql-general@arkaria.postgresql.org; Mon, 17 Jun 2019 14:12:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hcsMZ-0001wI-MD for pgsql-general@arkaria.postgresql.org; Mon, 17 Jun 2019 14:11:59 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hcsMY-0001nF-AI for pgsql-general@lists.postgresql.org; Mon, 17 Jun 2019 14:11:59 +0000 Received: from [66.111.4.28] (helo=out4-smtp.messagingengine.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hcsMV-0003rZ-6O for pgsql-general@lists.postgresql.org; Mon, 17 Jun 2019 14:11:57 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 2070D2224C; Mon, 17 Jun 2019 10:11:34 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 17 Jun 2019 10:11:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=p LZbcJyGs+xJZp2POwM0x2HcZnt0OhJNHYlZCLpkQ5w=; b=Z9gebnSsqJvTMPRNy 31Yf+4z3rE0wtvWx8DteAUimWxhqut+R19G1B+ZUpsOJP1HTKYK6plhum8X3eKcf bzExyJmdP4uYddFI6XNIlUKPPZtGUJse+T8QSbAWDJHoWynZMk7NViaHyqPEOVAS G1j6cL2Dt68OjOsi3udyAbZjh+Fd/x0JB0qEGNDpvpffEeyHlWMVSLt7UGf91ETv /BVVi3cmmsv3WbFS/z6SVrM0AeRLhJ1Ws7rUSx/EcUp+szXnVSfHX8xTTb2Yl0KQ 95sw/AXk/zA29HlUOwCtP16bMGJmWzXyZbVTn7VtGje5rFn6lbbQIsToKxq6KpzE 746tg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=pLZbcJyGs+xJZp2POwM0x2HcZnt0OhJNHYlZCLpkQ 5w=; b=ZbXo1Z/yuHvze34I47w5HD/0R0XrsbuaBXPJmfNkAVsjFAS5LBdCrIJ+Y 30nIdsu+stkgplt28ztR2ZtniUHpbPdIdRQ8Nb52AjhJn1C5t/RFScWm6RpEI1MA Y1FSvDRudP3Q9wrNKG55yrspni6KE6TpwZdtYuwc+ZknQg5gYaGTJhSBBuiiWkOp y/cPI+FqRJOG1nor1C8xXPlt/ii17//zEPzMC/oqxnE2sEqhOfSVaqWusLxSN6bi 021RLoEgpdC0MRZtB7PHx7Fai1k+Qw0lV2G3F94qlmv7sUIwFOgNsiFb7lXAj67U NT28Ts7s+gCx8t2JwigSnwv3PFkSA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrudeijedgjeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhffkffgfgggjtgfgsehtke ertddtfeejnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhk lhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecukfhppeejuddrvdduvddrudehtddrvd dtvdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghk lhgrvhgvrhdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from [192.168.1.4] (unknown [71.212.150.202]) by mail.messagingengine.com (Postfix) with ESMTPA id 2C90980063; Mon, 17 Jun 2019 10:11:33 -0400 (EDT) Subject: Re: bug regclass::oid To: John Mikel Cc: pgsql-general@lists.postgresql.org References: From: Adrian Klaver Message-ID: <66c3ca92-8276-669f-6f9e-d20a6f32ee10@aklaver.com> Date: Mon, 17 Jun 2019 07:11:32 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 66.111.4.28 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 6/17/19 1:58 AM, John Mikel wrote: > > hi again > > > here is my query > *select   A.table_name  as "table_name",A.domain_name as "domain",* > * format_type(c.atttypid, c.atttypmod)  AS data_type ,A.column_name as > "column_name",* > *  A.is_nullable as "nullable",A.column_default as "default"* > *  from information_schema.columns A inner  join pg_attribute c  on >  a.table_name::regclass::oid=c.attrelid* > *  where  a.table_schema in (select current_schema()) and  a.column_name > =c.attname ;* > > if i run this query in any database contain at least one table with > space in their name , an error will occur > if i run this query in other database will work fine > I tested this on pg 11.1  , pg 10.3, pg 9.6 > > PS:Sorry if this message is duplicated i canceled the previous message > by mistake by clicking on link > The previous message came through, see the replies. The basic issue is that a table name with a space in it will need to be quoted. So use quote_ident() per Peter and Tom's suggestions. -- Adrian Klaver adrian.klaver@aklaver.com