Thread: RE: [INTERFACES] Newbie question

RE: [INTERFACES] Newbie question

From
"Jackson, DeJuan"
Date:
>   Hello,
>
>    Please forgive me for a newbie question!
>
>    I have just installed and are running PostgreSQL 6.3.2 fine
> including
> psql on Linux 2.0.33.
>
>   I need to get access to it from several Windows 95 worstations using
> ODBC.
> I have a C++ program that are using ODBC/SQL... calls, which works
> fine on
> Linux using Sergey's pgodbc interface. The C++ program is written
> using a
> cross platform GUI library called wxWindows. This program is already
> running
> under Windows 95 without the ODBC interface, I just need to hook it up
> to
> my PostgreSQL database.
>
>    Could someone please give me a step-by-step idea of how to get ODBC
> running on Win95 and whatever tools/programs is needed for that?
Well, I've never done it myself, but I'll give it a shot.
1) get the newest driver from http://www.insightdist.com/psqlodbc and
compile it
2) set up your PostgreSQL database to use TCP/IP
   A) to do this add in the '-i' option when you start the postmaster
   B) edit you pg_hba.conf file appropriately.
3) Make sure you program is connecting to the correct machine, username,
and password.

>    I also have a PostgreSQL question: I have had the need for changing
> the attribute of a column, e.g. int2 -> int4 or char(10) -> char(20).
> psql doesn't seem to report how to do it, and whatever I tried failed.
> Is it at all possible? I have been working quite a lot with the very
> old
> Informix database, and here it is a simple matter for 'isql'.
You could try:
  ALTER TABLE table_name RENAME TO tmp_table;
  CREATE TABLE table_name (new_columns ...);
  INSERT INTO table_name SELECT old_columns ... FROM tmp_table;
  DROP TABLE tmp_table;
recreate the indexes and maybe VACUUM ANALYZE
The only problem with this is you'll have to make sure you can convert
from the original column type to the new one, 6.4 should handle this a
lot better when it comes out.


>     Thanks in advance,
You're welcome.

Hope this helps,
        -DEJ


Re: [INTERFACES] Newbie question

From
Byron Nikolaidis
Date:

Jackson, DeJuan wrote:

> >    Could someone please give me a step-by-step idea of how to get ODBC
> > running on Win95 and whatever tools/programs is needed for that?
> Well, I've never done it myself, but I'll give it a shot.
> 1) get the newest driver from http://www.insightdist.com/psqlodbc and
> compile it

FYI, there is a self-extracting, fully functional installation there
(postdrv.exe) for win95 -- you dont have to mess around with compiling if
you don't want to.  There is also just the compiled dll (postdll.zip), for
those who have done the full install at least once (just unzip into
\windows\system).

Byron