help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-smalltalk] Re: ROE and domains-table


From: Paolo Bonzini
Subject: [Help-smalltalk] Re: ROE and domains-table
Date: Wed, 26 Jan 2011 14:18:25 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7

On 01/25/2011 08:03 PM, Stefan Schmiedl wrote:
Paolo Bonzini (24.01. 22:32):

On 01/24/2011 10:03 PM, Stefan Schmiedl wrote:
Looks like it's somehow getting one of postgresql's system tables
instead of my public.domains.

I suggest you start from the query in dbd-postgresql/Table.st:

select column_name, data_type, character_maximum_length,
               numeric_precision, numeric_precision_radix, numeric_scale,
               is_nullable, ordinal_position
               from information_schema.columns
               where table_name = 'domains' and table_catalog = 'vmail'
               order by ordinal_position

fix it :) and see what needs to be changed.

If I didn't mess up, this diff should be against the current (as of 5 min ago)
master branch of the git repo.

diff --git a/packages/dbd-postgresql/Table.st b/packages/dbd-postgresql/Table.st
index f892fae..14f3f83 100644
--- a/packages/dbd-postgresql/Table.st
+++ b/packages/dbd-postgresql/Table.st
@@ -44,15 +44,15 @@ Table subclass: PGTable [
         | query resultSet |
         columnsArray isNil ifTrue: [
             query := 'select column_name, data_type, character_maximum_length,
                 numeric_precision, numeric_precision_radix, numeric_scale,
                 is_nullable, ordinal_position
                 from information_schema.columns
-               where table_name = %1 and table_catalog = %2
+               where table_schema = current_schema and table_name = %1 and 
table_catalog = %2
                 order by ordinal_position' % {
                     self name printString. self connection database 
printString }.
             resultSet := self connection select: query.
             columnsArray := resultSet rows
                 collect: [ :row | PGTableColumnInfo from: row ] ].
         ^columnsArray
      ]
  ]


Running this modified query shows only the two columns that I expect.

Fascinating stuff you can find in postgres. A bit non-obvious, but
fascinating :-)

Thanks, applied!

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]