Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to know if oracle style object oriented programming is possible in postgresql 8.4. I have installed orafce. When I tried to create a object like so:

CREATE TYPE addr_obj_typ AS OBJECT (
    street          VARCHAR2(30),
    city            VARCHAR2(20),
    state           CHAR(2),
    zip             NUMBER(5));

And I got this error:

ERROR:  syntax error at or near "object"
LINE 1: create type addr_obj_typ as object
share|improve this question
up vote 1 down vote accepted

Something like this?

    INT CHECK(VALUE < 99999)

CREATE TYPE addr_obj_typ AS  (
    street  VARCHAR(30),
    city    VARCHAR(20),
    state   CHAR(2),
    zip     zipcode

    CAST(('a','b','c','90210') AS addr_obj_typ);
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.