pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Tables/Columns in upper-case?
8+ messages / 5 participants
[nested] [flat]

* Tables/Columns in upper-case?
@ 2004-01-21 22:54  Stephen Frost <sfrost@snowman.net>
  0 siblings, 1 reply; 8+ messages in thread

From: Stephen Frost @ 2004-01-21 22:54 UTC (permalink / raw)
  To: pgsql-odbc

Greetings,

  Using the ODBC drivers under Windows 2000 and Access I've managed to
  'export' a table from Access to Postgres.  That's all well and good,
  however, when the table shows up in Postgres it's all *uppercase* for
  the name, and for all of the columns.  This is a rather large problem
  when everything I do in psql ends up in lowercase.  Shouldn't the ODBC
  driver be changing it all to lowercase, or the Postgresql server doing
  it or something?

  This is a rather annoying problem, unfortuantely.  Any suggestions?
  It's the stable non-unicode driver.

  	Thanks,

		Stephen

Attachments:

  signature.asc (application/pgp-signature, 188B) download

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: Tables/Columns in upper-case?
@ 2004-01-21 23:17  Stephen Frost <sfrost@snowman.net>
  parent: Andre Felipe Machado <andremachado@techforce.com.br>
  0 siblings, 1 reply; 8+ messages in thread

From: Stephen Frost @ 2004-01-21 23:17 UTC (permalink / raw)
  To: Andre Felipe Machado <andremachado@techforce.com.br>; +Cc: pgsql-odbc

* Andre Felipe Machado (andremachado@techforce.com.br) wrote:
> I guess that it is an Access issue or its MS driver, because I use OpenOffice 
> 1.1 connected to a PostgreSQL through odbc and can use upper or lower case.

That just means openoffice must do the upper->lower conversion for you.

> Actually, odbc adds double quotes in sql commands to encapsulate upper case 
> names in order to work in pg.

Hrm, so you can use ""'s around things in psql to maniuplate those
tables?  That's kind of annoying, but might be manageable (at least, to
rename the tables).

> It will be not a good idea to incorporate specific programs "features" into a 
> generic driver manager. Maybe into an Access odbc driver...

Eh.

> Suggestion:
> After exporting to PostgreSQL, execute a dump to a text file.
> Then, edit it to use only lower case and execute the sql into pg to create new 
> lowercase tables.

That'd be rather silly when I can just rename them by putting the table
name in ""s.  That's kind of annoying though, imv. :)

Thanks,

	Stephen

Attachments:

  signature.asc (application/pgp-signature, 188B) download

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: Tables/Columns in upper-case?
@ 2004-01-22 00:09  Jeff Eckermann <jeff_eckermann@yahoo.com>
  parent: Stephen Frost <sfrost@snowman.net>
  0 siblings, 1 reply; 8+ messages in thread

From: Jeff Eckermann @ 2004-01-22 00:09 UTC (permalink / raw)
  To: Stephen Frost <sfrost@snowman.net>; Andre Felipe Machado <andremachado@techforce.com.br>; +Cc: pgsql-odbc

--- Stephen Frost <sfrost@snowman.net> wrote:
> * Andre Felipe Machado
> (andremachado@techforce.com.br) wrote:
> > I guess that it is an Access issue or its MS
> driver, because I use OpenOffice 
> > 1.1 connected to a PostgreSQL through odbc and can
> use upper or lower case.
> 
> That just means openoffice must do the upper->lower
> conversion for you.
> 
> > Actually, odbc adds double quotes in sql commands
> to encapsulate upper case 
> > names in order to work in pg.
> 
> Hrm, so you can use ""'s around things in psql to
> maniuplate those
> tables?  That's kind of annoying, but might be
> manageable (at least, to
> rename the tables).
> 
> > It will be not a good idea to incorporate specific
> programs "features" into a 
> > generic driver manager. Maybe into an Access odbc
> driver...
> 
> Eh.
> 
> > Suggestion:
> > After exporting to PostgreSQL, execute a dump to a
> text file.
> > Then, edit it to use only lower case and execute
> the sql into pg to create new 
> > lowercase tables.
> 
> That'd be rather silly when I can just rename them
> by putting the table
> name in ""s.  That's kind of annoying though, imv.
> :)

Take a look at the Database Migration Wizard that
comes with PgAdminII (and PgAdminIII as well?  I
haven't checked that out).  Amongst its many handy
features, you can opt to lowercase all identifiers
(e.g. table names).  You should be able to find it via
http://pgadmin.postgresql.org .

__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: Tables/Columns in upper-case?
@ 2004-01-22 00:14  Andre Felipe Machado <andremachado@techforce.com.br>
  parent: Stephen Frost <sfrost@snowman.net>
  0 siblings, 1 reply; 8+ messages in thread

From: Andre Felipe Machado @ 2004-01-22 00:14 UTC (permalink / raw)
  To: pgsql-odbc

Hello,
I guess that it is an Access issue or its MS driver, because I use OpenOffice 
1.1 connected to a PostgreSQL through odbc and can use upper or lower case.
Actually, odbc adds double quotes in sql commands to encapsulate upper case 
names in order to work in pg.
It will be not a good idea to incorporate specific programs "features" into a 
generic driver manager. Maybe into an Access odbc driver...
Suggestion:
After exporting to PostgreSQL, execute a dump to a text file.
Then, edit it to use only lower case and execute the sql into pg to create new 
lowercase tables.
Good luck.
Andre Felipe
http://www.andrefelipemachado.hpg.ig.com.br/linux/index.html  
Brazilian portuguese




^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: Tables/Columns in upper-case?
@ 2004-01-22 05:12  Ben Ramsey <br@benandliz.com>
  parent: Jeff Eckermann <jeff_eckermann@yahoo.com>
  0 siblings, 1 reply; 8+ messages in thread

From: Ben Ramsey @ 2004-01-22 05:12 UTC (permalink / raw)
  To: pgsql-odbc

We used PgAdminIII to migrate an Access database to PostgreSQL, but I 
believe that we had to set all the table names to lowercase in Access 
before we migrated it.  It did, however, automatically set our column 
names to lowercase for us.  Consequently, if we didn't set the table 
names to lowercase in Access before migrating, then we had to place 
single quotes around the table names in all of our SQL statements (which 
continued to use the capital letters in them), but if we set the table 
names to lowercase before the migration, then we didn't have to put the 
single quotes around the table names in our SQL statements when they 
were hitting the Postgres DB (despite the fact that the names in the SQL 
statements retained the capitalization as defined in the Access table... 
weirdness).

Jeff Eckermann wrote:
> Take a look at the Database Migration Wizard that
> comes with PgAdminII (and PgAdminIII as well?  I
> haven't checked that out).  Amongst its many handy
> features, you can opt to lowercase all identifiers
> (e.g. table names).  You should be able to find it via
> http://pgadmin.postgresql.org .



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: Tables/Columns in upper-case?
@ 2004-01-22 08:48  Dave Page <dpage@vale-housing.co.uk>
  0 siblings, 0 replies; 8+ messages in thread

From: Dave Page @ 2004-01-22 08:48 UTC (permalink / raw)
  To: Jeff Eckermann <jeff_eckermann@yahoo.com>; Stephen Frost <sfrost@snowman.net>; Andre Felipe Machado <andremachado@techforce.com.br>; +Cc: pgsql-odbc

 

> -----Original Message-----
> From: Jeff Eckermann [mailto:jeff_eckermann@yahoo.com] 
> Sent: 22 January 2004 00:10
> To: Stephen Frost; Andre Felipe Machado
> Cc: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] Tables/Columns in upper-case?
> 
> Take a look at the Database Migration Wizard that comes with 
> PgAdminII (and PgAdminIII as well?  I haven't checked that 
> out).  

Nope, no migration wizard in pga3. :-( If there are any bored C++
programmers out there though...

As for the quotes, neither psqlodbc or PostgreSQL will fold them to
uppercase - Access must be doing that.

The rule is, if unquoted, an object name may contain a through z, 0
though 9 or an underscore. If you try to use upper case characters, they
will be folded to lowercase by the server. To use uppercase, or any
other characters in identifiers you must quote them.

Regards, Dave.



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: Tables/Columns in upper-case?
@ 2004-01-22 14:50  Jeff Eckermann <jeff_eckermann@yahoo.com>
  parent: Ben Ramsey <br@benandliz.com>
  0 siblings, 1 reply; 8+ messages in thread

From: Jeff Eckermann @ 2004-01-22 14:50 UTC (permalink / raw)
  To: Ben Ramsey <br@benandliz.com>; pgsql-odbc

--- Ben Ramsey <br@benandliz.com> wrote:
> We used PgAdminIII to migrate an Access database to
> PostgreSQL, but I 
> believe that we had to set all the table names to
> lowercase in Access 
> before we migrated it.  It did, however,
> automatically set our column 
> names to lowercase for us.  Consequently, if we
> didn't set the table 
> names to lowercase in Access before migrating, then
> we had to place 
> single quotes around the table names in all of our
> SQL statements (which 
> continued to use the capital letters in them), but
> if we set the table 
> names to lowercase before the migration, then we
> didn't have to put the 
> single quotes around the table names in our SQL
> statements when they 
> were hitting the Postgres DB (despite the fact that
> the names in the SQL 
> statements retained the capitalization as defined in
> the Access table... 
> weirdness).

With PgAdminII's Migration Wizard, none of this is
necessary.  Dave Page confirms in a separate email
that the Wizard has not yet been implemented in
PgAdminIII, which is a pity, seeing that III is
otherwise the "latest and greatest".

> 
> Jeff Eckermann wrote:
> > Take a look at the Database Migration Wizard that
> > comes with PgAdminII (and PgAdminIII as well?  I
> > haven't checked that out).  Amongst its many handy
> > features, you can opt to lowercase all identifiers
> > (e.g. table names).  You should be able to find it
> via
> > http://pgadmin.postgresql.org .
> 
> ---------------------------(end of
> broadcast)---------------------------
> TIP 8: explain analyze is your friend


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: Tables/Columns in upper-case?
@ 2004-01-22 15:04  Ben Ramsey <br@benandliz.com>
  parent: Jeff Eckermann <jeff_eckermann@yahoo.com>
  0 siblings, 0 replies; 8+ messages in thread

From: Ben Ramsey @ 2004-01-22 15:04 UTC (permalink / raw)
  To: Jeff Eckermann <jeff_eckermann@yahoo.com>

Hmm.  I'll have to ask one of our other programmers how he converted the 
database, then.  I could've sworn he used PgAdminIII to do it.
-Ben

Jeff Eckermann wrote:
> With PgAdminII's Migration Wizard, none of this is
> necessary.  Dave Page confirms in a separate email
> that the Wizard has not yet been implemented in
> PgAdminIII, which is a pity, seeing that III is
> otherwise the "latest and greatest".



^ permalink  raw  reply  [nested|flat] 8+ messages in thread


end of thread, other threads:[~2004-01-22 15:04 UTC | newest]

Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-01-21 22:54 Tables/Columns in upper-case? Stephen Frost <sfrost@snowman.net>
2004-01-22 00:14 ` Andre Felipe Machado <andremachado@techforce.com.br>
2004-01-21 23:17   ` Stephen Frost <sfrost@snowman.net>
2004-01-22 00:09     ` Jeff Eckermann <jeff_eckermann@yahoo.com>
2004-01-22 05:12       ` Ben Ramsey <br@benandliz.com>
2004-01-22 14:50         ` Jeff Eckermann <jeff_eckermann@yahoo.com>
2004-01-22 15:04           ` Ben Ramsey <br@benandliz.com>
2004-01-22 08:48 Re: Tables/Columns in upper-case? Dave Page <dpage@vale-housing.co.uk>

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