Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

How to convert Centura Long String into PostgreSQL Text

How to convert Centura Long String into PostgreSQL Text

How to convert Centura Long String into PostgreSQL Text

Hi to all,

I experienced a problem when inserting/updating a PostgreSQL table out from Centura Team Developer.

The variable in Centura is defined as Long String and the correspnodent column in the database is defined as text or varchar().

The result is the same. The database sends an error message to use the functions lo_import() or lo_export() for large objects.

Unfortunately take this functions only a filename as parameter. But I have no file at that moment and I do not want to save my variable to a file.

What I want, is to put my Long  String from Centura into the Text column in the table (in the same way as it works with varchar(250))

Has anybody an idea how work around this problem?

Any hint is appreciated

With best regards


RE: How to convert Centura Long String into PostgreSQL Text

What is Centura Team Developer, and what method are you using to connect to the PostgreSQL database? ODBC? JDBC?


"Now, this might cause some discomfort..."

RE: How to convert Centura Long String into PostgreSQL Text

I use ODBC and PostgreSQL 7.2. on Win2000 with the cygwin environment.

Centura Team Developer is a very comfortable IDE with native database support for many backends. And those which are not supported native, can be accessed via ODBC.

RE: How to convert Centura Long String into PostgreSQL Text

Hi gregitg,

Have you tried updating the Centura Team Developer long string to a text field.  This might work since a text defined field is not limited.

I extracted the following form the postgres 7.1.2 doc.

3.3. Character Types
SQL defines two primary character types: character and character varying. Postgres supports these types, in addition to the more general text type, which unlike character varying does not require an explicit declared upper limit on the size of the field.

Refer to Section for information about the syntax of string literals, and to Chapter 4 for information about available operators and functions.

Table 3-4. Character Types

Type Name Storage Recommendation Description
character(n), char(n) (4+n) bytes SQL-compatible Fixed-length blank padded
character varying(n), varchar(n) (4+n) bytes SQL-compatible Variable-length with limit
text (4+n) bytes Most flexible Variable unlimited length

Note: Although the type text is not SQL-compliant, many other RDBMS packages have it as well.

There are two other fixed-length character types in Postgres. The name type exists only for storage of internal catalog names and is not intended for use by the general user. Its length is currently defined as 32 bytes (31 characters plus terminator) but should be referenced using the macro NAMEDATALEN. The length is set at compile time (and is therefore adjustable for special uses); the default maximum length may change in a future release. The type "char" (note the quotes) is different from char(1) in that it only uses one byte of storage. It is internally used in the system catalogs as a poor-man's enumeration type.

You may need to try several field type combinations until you find one that maps the Centura Team Developer long string between the front-end and postgres correctly.

Leland F. Jackson, CPA
Software - Master (TM)
Nothing Runs Like the Fox

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close