public inbox for [email protected]
help / color / mirror / Atom feedFrom: Sebastiaan Mannem <[email protected]>
To: Daniel Cohen <[email protected]>
Cc: Christophe Pettus <[email protected]>
Cc: [email protected]
Subject: Re: Creating dynamically-typed tables using psycopg2's built-in formatting
Date: Fri, 14 Jun 2019 19:44:07 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAHAzoYn6a73nb_cZ-vuFiq=x0bTPyYYu9CyWmXFiLEtuhM2JTg@mail.gmail.com>
References: <CAHAzoYkzXi1HFE0PmY3z0qn4SRnSZLdhChPUePf-2VwTM91upg@mail.gmail.com>
<[email protected]>
<CAHAzoYnrmM2MG8MLzG0mpP-sa0TVPgi1bA9hT0P-JuXRszbuVQ@mail.gmail.com>
<[email protected]>
<CAHAzoYn6a73nb_cZ-vuFiq=x0bTPyYYu9CyWmXFiLEtuhM2JTg@mail.gmail.com>
Yeah,
"schema.tbl" will search all schemas in search path for a table explicitly called "schema.tbl".
So that will never find a table called "tbl", and most probably never find a table at all.
And without quotes, it will search for a table called "tbl" in a schema called "schema".
So your issue makes perfect sense now.
FWIW, if you where to query "schema"."tbl", it would look for a table (or view) called "tbl" in a schema called "schema",
Which seems to be what you want.
Sebastiaan Alexander Mannem
Senior Consultant
Anthony Fokkerweg 1
1059 CM Amsterdam, The Netherlands
T: +31 6 82521560
www.edbpostgres.com
> On 14 Jun 2019, at 18:41, Daniel Cohen <[email protected]> wrote:
>
> Hi again,
>
> I realize the error was that I specified the name as "schema.tbl", and I think because there was a period in the name, it converted to double-quote. I tried again as just "tbl" and it worked perfectly. Thanks so much for all your help.
>
> Best,
>
> Danny
>
> On Fri, Jun 14, 2019 at 9:12 AM Christophe Pettus <[email protected] <mailto:[email protected]>> wrote:
>
>
> > On Jun 13, 2019, at 13:54, Daniel Cohen <[email protected] <mailto:[email protected]>> wrote:
> >
> > Thanks so much for your response. The uppercase --> lowercase fix worked for the types, but I'm still only getting tables that can be searched by double-quotations (i.e. > SELECT * FROM tbl; returns nothing, but > SELECT * FROM "tbl"; returns the table I uploaded).
>
> By "returns nothing," do you mean you get an error, or that you get zero rows?
>
> I'd connect to the database using psql and use \d to see what tables actually exist.
> --
> -- Christophe Pettus
> [email protected] <mailto:[email protected]>
>
Attachments:
[image/png] email_logo.png (3.4K, ../[email protected]/3-email_logo.png)
download | view image
[image/png] social_rss.png (549B, ../[email protected]/4-social_rss.png)
download | view image
[image/png] social_fb.png (295B, ../[email protected]/5-social_fb.png)
download | view image
[image/png] social_tw.png (403B, ../[email protected]/6-social_tw.png)
download | view image
[image/png] social_li.png (415B, ../[email protected]/7-social_li.png)
download | view image
[image/png] social_gp.png (462B, ../[email protected]/8-social_gp.png)
download | view image
view thread (13+ messages) latest in thread
reply
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 using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Creating dynamically-typed tables using psycopg2's built-in formatting
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox