From: Adrian Klaver <adrian.klaver@aklaver.com>
To: John Mikel <blpmftat@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: bug regclass::oid
Date: Thu, 13 Jun 2019 08:33:18 -0700
Message-ID: <fc6a3ada-db64-a6e1-b5d7-4f4b2882eb4c@aklaver.com> (raw)
In-Reply-To: <CAAC-7YB4HUCZ2pq1FEndxYAzRgy8CcGzU0YGVsNAcDLm6nC6kw@mail.gmail.com>
References: <CAAC-7YB4HUCZ2pq1FEndxYAzRgy8CcGzU0YGVsNAcDLm6nC6kw@mail.gmail.com>
On 6/13/19 8:14 AM, John Mikel wrote:
> * hi ,
> i am here to tell you that this test in query is not working when the
> table name in the database or schema name contain space
> a.table_name::regclass=b.attrelid
>
> a is information_schema.columns
> b is pg_attribute
>
> trying this in two different databases the first database contain table
> with space in his name (Problem when running query)
> the second no ( work fine)
>
> the same problme if you get Oid from schema name.
> SELECT 'public'::regnamespace::oid; work ;
> create schema " this is test" ;
> SELECT 'this is test'::regnamespace::oid; not working ;
Try:
SELECT '"this is test"'::regnamespace::oid; not working ;
Same for table name. As example:
select '"space table"'::regclass;
regclass
---------------
"space table"
(1 row)
>
> i have question how use join between information_schema.columns and
> pg_attribute ? thanks
>
> regards*
--
Adrian Klaver
adrian.klaver@aklaver.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: adrian.klaver@aklaver.com, blpmftat@gmail.com
Subject: Re: bug regclass::oid
In-Reply-To: <fc6a3ada-db64-a6e1-b5d7-4f4b2882eb4c@aklaver.com>
References: <CAAC-7YB4HUCZ2pq1FEndxYAzRgy8CcGzU0YGVsNAcDLm6nC6kw@mail.gmail.com> <fc6a3ada-db64-a6e1-b5d7-4f4b2882eb4c@aklaver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox