tdbc::postgres

View Ticket
Login
Ticket Hash: 2e14854f4f65874b001962b8b55232baf1fa6872
Title: [db columns table] doesn't recognize schema names
Status: Open Type: Code_Defect
Severity: Severe Priority: Immediate
Subsystem: not_specified Resolution: Open
Last Modified: 2018-09-14 19:07:11
Version Found In: 1.0.0
User Comments:
anonymous added on 2015-09-02 16:33:04: (text/html)
A console session to illustrate the problem follows below. Note that the documentation says: <p>
"The columns object command allows the program to query the connection for the names of columns that exist in a <b>given</b> table." 
<p>In Postgres you identify tables by a fully qualified name, using the following name convention:
<schema name>.<table name>
<p><hr>
Main console display active (Tcl8.6.4 / Tk8.6.4)<p>
(System32) 49 % package require tdbc::postgres<p>
<i>1.0.0</i><p>
(System32) 50 % tdbc::postgres::connection create db -user postgres -password postgres -db mydb<p>
<i>::db</i><p>
(System32) 51 % db allrows {create schema myschema}<p>
(System32) 52 % db allrows {create table myschema.mytable (id serial primary key, field1 text)}<p>
(System32) 53 % db columns myschema.mytable field1<p>
(System32) 54 % db columns mytable field1<p>
<i>relation "mytable" does not exist</i><p>
(System32) 55 % db allrows {set search_path=myschema,public}<p>
(System32) 56 % db columns mytable field1<p>
<i>field1 {name field1 type text nullable 1}<i><p>
(System32) 57 % <p>

adrianmedranocalvo (claiming to be [email protected]) added on 2018-09-14 19:07:11: (text/x-fossil-plain)
Please have a look at branch medranocalvo-correct-quoting [9485f6bb80].  Does it solve your problem?