Re: Quick hack for fetching the contents of a temp table

From: Michel Pelletier <pelletier(dot)michel(at)gmail(dot)com>
To: Souvik Bhattacherjee <kivuosb(at)gmail(dot)com>
Cc: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Quick hack for fetching the contents of a temp table
Date: 2019-04-24 00:38:06
Message-ID: CACxu=vJdj2aonCpwhOmQhAvOiF91b5tEAujUsg0Rcaze3o-CfQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Apr 23, 2019 at 2:56 PM Souvik Bhattacherjee <kivuosb(at)gmail(dot)com>
wrote:

> Hi,
>
> I need to use the return value of the function somefunction1() to modify a
> query and execute it.
>
> While it is easy to fetch the desired result using plpgsql functions(),
> however modifying and rewriting the query using the plpgsql does not seem
> straightforward. Therefore I have already written the query modification
> function within the postgres server since I need to use the results from
> pg_parse_query() method.
>
>
This question seems related to the other thread you started on April 18th?
Several of us suggested you use a CTE to materialize your intermediate
values. Did you try that? The example you provided was not complete, and
I asked for a reproducible example of what you were trying to achieve and
you didn't provide one. I'm all for encouraging people to hack in the
core, but it seems like you have the impression that your goal is not
possible in SQL when it very likely is. Changing the core is not only
going to be a high maintenance burden on you, but it also implies you have
a problem that no one else in 30 years of postgres development has had.
What's more likely is that it is possible to do what you want in SQL and
we'd like to help you, but we need more information and you need to try the
suggestions and answer the questions we ask back of you.

I'm happy to be wrong about this, because that means postgres can improve
in some way, but first we need more information about what your problem
actually is.

-Michel

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Souvik Bhattacherjee 2019-04-24 01:46:36 Re: Quick hack for fetching the contents of a temp table
Previous Message Souvik Bhattacherjee 2019-04-23 23:11:54 Re: Is it possible to store the output of EXPLAIN into a table