Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8908345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:09:12+00:00 2026-06-15T03:09:12+00:00

I want to create a new data type and new operators in PostgreSQL. I

  • 0

I want to create a new data type and new operators in PostgreSQL.
I saw that in the documentation, it is possible to incorporate new source files in C (for example) and create a new data type and operators. PostgreSQL is extensible in that direction. More information at: documentation

But also the PostgreSQL has open source, and I could alter the source code and add a new data type, compiling a new version.

With that, I want to know what the differences, advantages and disadvantages of each method of including a new data type in PostgreSQL. I’m very concerned about the performance in query processing.
Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T03:09:13+00:00Added an answer on June 15, 2026 at 3:09 am

    I fully agree with Jachim’s answer.
    Another thing is:

    Developing your own C-Language extension in PostgreSQL is (rather) well documented – simple programs can be done by compiling just one function of code and writing the corresponding functions. Adding a custom datatype is a bit more complicated, but still doable. The extension I developed was even written in C++ with just a bit of wrapper glue between PostgreSQL’s plain C – that made developing much more flexible.

    Altering the PostgreSQL core however is more complicated in terms of how do you start and what do you do. And in the end, you archive the same.

    To sum it up: C-Language functions gives you all the advantages:

    • High performance by utilising PostgreSQLs internal datatypes
    • Simple programming interface
    • Just a small bit of code with a documented and presumably very stable function interface

    I can not see any advantages of altering PostgreSQLs core, but many disadvantages:

    • Long compilation times
    • Maintaining your own code branch and regularly reapplying your patch to the current release
    • Higher risk of bugs.

    If you need an example of a lot of different ways to use the C-Language interface, have a look at the PostGis source code – they use nearly all function types and have a lot of fancy tricks in their code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What I'm trying to do is create a new custom data type that behaves
Suppose I'd want to create a new data type and make the constructors showable,
I want to create a new element with html5 data attributes defined, however they
I'm new to Java. I want to create Java Array and insert data into
I want to create a new field (or two) in my table that is
I want to create a new file while file type is choosing by the
I want to add metadata to my object graph for non-domain type data that
I have 4 different groups of data that I want to: create, update, delete
I want to create new WCF service and client. The 2 parties will communicate
I want to create new creative and check its audit status in facebook ads

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.