database.sarang.net
UserID
Passwd
Database
DBMS
MySQL
ㆍPostgreSQL
Firebird
Oracle
Informix
Sybase
MS-SQL
DB2
Cache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
PostgreSQL Tutorials 3822 게시물 읽기
 News | Q&A | Columns | Tutorials | Devel | Files | Links
No. 3822
Quick HOWTO - connecting StarOffice Win or Lin to PostGreSQL using ODBC
작성자
정재익(advance)
작성일
2001-12-30 22:12
조회수
4,469

Quick HOWTO - connecting StarOffice Win or Lin to PostGreSQL using ODBC

 

원본 출처 : http://archives2.us.postgresql.org/pgsql-odbc/2001-06/msg00109.php

 

이글은 StarOffice 에서 ODBC 를 이용하여 PostgreSQL 로 접속하는 방법에 대해 적어 놓은 글이다.

 

We have had some problems to enable connection between StarOffice (on GNU/Linux and on Windows systems) to a PostGreSQL database (running on GNU/Linux) over ODBC connection.

 

Here is a quick howto I wrote as a reminder of the problems and

solutions we found.

 

Hope you find it useful.

 

Regards,

 

$Id: ConfigurationOdbc,v 1.2 2001/06/26 12:51:53 oberger Exp $

 

We have encountered problems to enable access to a GNU/Linux server running PostGreSQL, from Linux and Windows platforms, both using

StarOffice? to access the database (using de StarBase? forms and

reports).

 

Our goal was to be able to interoperate with the database (read and

write) from both platforms in a unified way (same forms, look and feel).

 

The database connectivity from StarOffice? is made with ODBC.

 

StarOffice? configuration to access ODBC data sources is quite the same once the ODBC sources have been defined.

 

We use the following ODBC drivers :

        unixodbc 2.0.4 for GNU/Linux, from http://www.unixodbc.org/
(package Debian 2.0.4-0.potato3) 
        psqlodbc 7.1.0005 for Windows, from http://odbc.postgresql.org/
(zip file)

 

Problems encountered

 

The unixodbc driver, as packaged with the debian distribution does not

include a "default" /usr/lib/libodbcpsql.so file. Thus you have to

specify the right libodbcpsql.so.* file in the .odbc.ini or odbc.ini /

odbcinst.ini files or create the appropriate link. See below.

 

The tables must have a primary key defined with a consttraint or index

in PostGreSQL in order to allow read-write access to the table from

StarOffice?.

 

The tables indices for primary keys must be named according to the

following scheme in order to be recognized by the PsqlODBC ODBC driver for windows : "{table}_pkey" (see the FAQ http://www.ca.postgresql.org/ftpsite/odbc/faq.html#primarykeys)

 

Configuring the PostGreSQL DataBase? server

 

The file pg_hba.conf should specify that PostGreSQL network access is

allowed from the client machines and users.

 

The postmaster.init file should include the option allowing network

connection (and be launched with -i option)

  PGALLOWTCPIP=yes

Configuring the GNU/Linux ODBC driver to allow access to the remote

server

 

We configured the .odbc.ini file with :

  [ODBC Data Source]
  funnel                  = funnel

  [funnel]
  Description            = FUNNEL satanas
  Driver            = /usr/lib/libodbcpsql.so
  Trace            = No
  Database            = template1
  Servername            = servername.domain.com
  UserName?            = postgres
  Password            = postgres
  ReadOnly?            = No

Beware that the library /usr/lib/libodbcpsql.so exist. If not, create a

link to the appropriate libodbcpsql.so.* file.

 

Configuring the Windows ODBC driver to allow access to the remote server

 

You should verify that the Read-Only checkboxes aren't checked in the

configuration option dialogs of the driver.

 

Creating tables structure

 

If you want to allow read-write access to the tables from StarOffice?

via the windows ODBC PostGreSQL driver, tables must have a primary

key named "{table}_pkey" (see the FAQ

http://www.ca.postgresql.org/ftpsite/odbc/faq.html#primarykeys)

 

By default, it will be OK if you create the table like this :

  CREATE SEQUENCE "table_seq";

  CREATE TABLE mytable (
          "id" INTEGER PRIMARY KEY DEFAULT NEXTVAL('table_seq'),
            ...
  );

If you use a CONSTRAINT definition, you should pay attention to the name of the constraint :

  CREATE SEQUENCE "table_seq";

  CREATE TABLE mytable (
          "id" INTEGER DEFAULT NEXTVAL('table_seq'),

  ...

          CONSTRAINT "mytable_pkey" PRIMARY KEY("id")
  );
[Top]
No.
제목
작성자
작성일
조회
3845PL/pgSQL - SQL procedural language (2)
정재익
2002-01-07
8441
3844PL/pgSQL - SQL procedural language (1)
정재익
2002-01-07
8110
3831부분 인덱스 사용법
정재익
2002-01-01
5197
3822Quick HOWTO - connecting StarOffice Win or Lin to PostGreSQL using ODBC
정재익
2001-12-30
4469
3820Freeware PostgreSQL/iX for HP e3000 MPE
정재익
2001-12-30
3918
3817PostgreSQL FAQ - Sun Solaris specific
정재익
2001-12-29
3579
3816PostgreSQL Install FAQ
정재익
2001-12-29
5397
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2020 DSN, All rights reserved.
작업시간: 0.040초, 이곳 서비스는
	PostgreSQL v13.0으로 자료를 관리합니다