Search for text in any function - Mailing list pgsql-general

From Rob Richardson
Subject Search for text in any function
Date
Msg-id 04A6DB42D2BA534FAC77B90562A6A03DCD3E84@server.rad-con.local
Whole thread Raw
Responses Re: Search for text in any function
List pgsql-general
Greetings!
 
Can anyone suggest a query that will tell me the names of all functions (both trigger and normal) that contain a given string of text?
 
Here's what happened:
 
My company's database has a table named "charge" and a view named "availcharges" that returns all charges that are available.  The view's SELECT statement lists all fields in the charge table explictly.
 
We have two functions that use data in the charge table the same way:
 
declare
    ChargeRec charge%rowtype
begin
    select into ChargeRec * from availcharges
 
This used to work.  But then one of us added a field to the charge table, as the last field in the table.  The availcharges view was adjusted accordingly.  However, behind the scenes something changed.  I'm pretty sure that the view no longer returns fields in the same order.  My immediate fix was to suggest using either
 
declare
    ChargeRec record;
 
or
 
declare
    ChargeRec availcharges%rowtype;
 
Either one works. 
 
But I need to make sure that we don't get burned by this anywhere else.  Therefore, I would like to be able to find all functions that uses the phrase "charge%rowtype".  I haven't been able to find where the text of functions is stored. 
   
Thank you very much.
 
RobR
 

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Aliasing syntax question
Next
From: Sam Mason
Date:
Subject: Re: When adding millions of rows at once, getting out of disk space errors