Re: Dynamic Loading Library! Extension using C Function

From: Willy-Bas Loos <willybas(at)gmail(dot)com>
To: Bilal Sadiq <m_bilalsadiq(at)hotmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Dynamic Loading Library! Extension using C Function
Date: 2012-04-18 07:36:57
Message-ID: CAHnozTj14SX8bOrqe-FLSc_W_b=kEpqUPcZ41-5Rwf=SC2iKcw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

your description is somewhat unclear but it seems that you want to query
several tables with a common column in one query.
maybe inheritance is useful for you?
http://www.postgresql.org/docs/9.1/static/ddl-inherit.html

the point is, a table can have "child tables" and you automatically query
the child tables when you query the parent.
the parent can be empty, then you just have a bunch of tables that you can
query separately, or all together.
the advantage would be that you don't have to write a function for
everything you do... you can just use all of the usual functionality.
and if it is what you want and you are looking for performance improvement,
you should look into partitioning and constraint exclusion.

HTH

WBL

On Sat, Mar 31, 2012 at 3:36 PM, Bilal Sadiq <m_bilalsadiq(at)hotmail(dot)com>wrote:

> Dear PostgreSQL Community,
>
> I just started learning PostgreSQL, and I am trying to develop a extension
> for postgre using SRF but I am stuck that how do I get the values by
> passing the constant integer value against a field/column without using the
> table name as argument. I already read the Xfunction document portion and
> successfully executed all most all the examples provided.
>
> Suppose my query is
>
> select get_all_greater_values(column_name, 2000) from table_name;
>
> column_name
> 1000
> 2000
> 3000
> 4000
>
> Result
> 3000
> 4000
>
> Kindly help me for the above query and also suggest whether it is good to
> use the SRF or there is any other way to get results from this query. I
> want to implement extension code using C language as dynamic loading
> library. I really appreciate your concerns.
>
>
> Regards
>
> M. Bilal Sadiq
>

--
"Patriotism is the conviction that your country is superior to all others
because you were born in it." -- George Bernard Shaw

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Roberto Caravani 2012-04-18 12:16:20 Re: unique constraint
Previous Message Willy-Bas Loos 2012-04-18 07:22:05 Re: PgOLEDB.dll