Re: Materialized view in Postgres from the variables rather than SQL query results

2023-12-01 Thread Nurul Karim Rafi
Hi David,
Thanks for replying back.
Already did that but haven’t received anything yet.

On Fri, Dec 1, 2023 at 7:40 PM David G. Johnston 
wrote:

> This mailing list is for discussing the development of patches to the
> PostgreSQL code base.  Please send your request for help to a more
> appropriate list - specifically the -general list.
>
> David J.
>
>
> On Thursday, November 30, 2023, Nurul Karim Rafi 
> wrote:
>
>> I have a stored procedure in Postgres. I have generated some variables in
>> that procedure. These variables are generated inside a loop of query
>> result. Suppose if i have 10 rows from my query then for 10 times I am
>> generating those variables.
>>
>> Now I want to create a materialized view where these variables will be
>> the columns and every row will have values of those variables generated in
>> every iteration of that loop.
>>
>> What can be the better approach for this?
>>
>> I can create a temporary table with those variables and insert values in
>> every iteration of that loop but that will not serve my purpose. Because I
>> want to drop my existing table where all the values are available and
>> columns are those variables. My target is to make a materialized view with
>> those variables so that I can get rid of that parent table.
>>
>> Best Regards
>>
>> *Rafi*
>>
>


Re: Materialized view in Postgres from the variables rather than SQL query results

2023-12-01 Thread David G. Johnston
This mailing list is for discussing the development of patches to the
PostgreSQL code base.  Please send your request for help to a more
appropriate list - specifically the -general list.

David J.


On Thursday, November 30, 2023, Nurul Karim Rafi 
wrote:

> I have a stored procedure in Postgres. I have generated some variables in
> that procedure. These variables are generated inside a loop of query
> result. Suppose if i have 10 rows from my query then for 10 times I am
> generating those variables.
>
> Now I want to create a materialized view where these variables will be the
> columns and every row will have values of those variables generated in
> every iteration of that loop.
>
> What can be the better approach for this?
>
> I can create a temporary table with those variables and insert values in
> every iteration of that loop but that will not serve my purpose. Because I
> want to drop my existing table where all the values are available and
> columns are those variables. My target is to make a materialized view with
> those variables so that I can get rid of that parent table.
>
> Best Regards
>
> *Rafi*
>


Materialized view in Postgres from the variables rather than SQL query results

2023-11-30 Thread Nurul Karim Rafi
I have a stored procedure in Postgres. I have generated some variables in
that procedure. These variables are generated inside a loop of query
result. Suppose if i have 10 rows from my query then for 10 times I am
generating those variables.

Now I want to create a materialized view where these variables will be the
columns and every row will have values of those variables generated in
every iteration of that loop.

What can be the better approach for this?

I can create a temporary table with those variables and insert values in
every iteration of that loop but that will not serve my purpose. Because I
want to drop my existing table where all the values are available and
columns are those variables. My target is to make a materialized view with
those variables so that I can get rid of that parent table.

Best Regards

*Rafi*