Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group