Thread: Search the schema

Search the schema

From
Michael Shapiro
Date:
I am looking for the ability to search the schema. I'd like to be able to see, for example, where a particular string
occursin a function or a view or table (or perhaps other objects). Right now I am forced to dump the schema and then
searchoutside PgAdmin. <br /><br />So, I guess, I am asking for such a feature to be added to PgAdmin.<br /> 

Re: Search the schema

From
Guillaume Lelarge
Date:
On Tue, 2012-07-17 at 09:44 -0500, Michael Shapiro wrote:
> I am looking for the ability to search the schema. I'd like to be able to
> see, for example, where a particular string occurs in a function or a view
> or table (or perhaps other objects). Right now I am forced to dump the
> schema and then search outside PgAdmin.
> 
> So, I guess, I am asking for such a feature to be added to PgAdmin.

pgAdmin 1.16 (right now in beta) gives you the ability to search for
objects' names that contain a specific string. But I guess it doesn't go
as far as you want, does it?


-- 
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com



Re: Search the schema

From
Michael Shapiro
Date:
No, it doesn't.<br /><br /> For example, I want to see if a given string is used within a function.<br /> I want to be
ableto see all the uses of a function: in other functions, in select stmts in views, etc.<br /><br /><br /><br /><div
class="gmail_quote">OnTue, Jul 17, 2012 at 10:39 AM, Guillaume Lelarge <span dir="ltr"><<a
href="mailto:guillaume@lelarge.info"target="_blank">guillaume@lelarge.info</a>></span> wrote:<br /><blockquote
class="gmail_quote"style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div
class="h5">OnTue, 2012-07-17 at 09:44 -0500, Michael Shapiro wrote:<br /> > I am looking for the ability to search
theschema. I'd like to be able to<br /> > see, for example, where a particular string occurs in a function or a
view<br/> > or table (or perhaps other objects). Right now I am forced to dump the<br /> > schema and then search
outsidePgAdmin.<br /> ><br /> > So, I guess, I am asking for such a feature to be added to PgAdmin.<br /><br
/></div></div>pgAdmin1.16 (right now in beta) gives you the ability to search for<br /> objects' names that contain a
specificstring. But I guess it doesn't go<br /> as far as you want, does it?<br /><span class="HOEnZb"><font
color="#888888"><br/><br /> --<br /> Guillaume<br /><a href="http://blog.guillaume.lelarge.info"
target="_blank">http://blog.guillaume.lelarge.info</a><br/><a href="http://www.dalibo.com"
target="_blank">http://www.dalibo.com</a><br/><br /></font></span></blockquote></div><br /> 

Re: Search the schema

From
Francisco Leovey
Date:
Do a backup in sql mode (not compressed) and load the output to a text editor.
There you can find anything you need.
 

From: Michael Shapiro <mshapiro51@gmail.com>
To: Guillaume Lelarge <guillaume@lelarge.info>
Cc: PgAdmin Support <pgadmin-support@postgresql.org>
Sent: Tuesday, July 17, 2012 12:59 PM
Subject: Re: [pgadmin-support] Search the schema

No, it doesn't.

For example, I want to see if a given string is used within a function.
I want to be able to see all the uses of a function: in other functions, in select stmts in views, etc.



On Tue, Jul 17, 2012 at 10:39 AM, Guillaume Lelarge <guillaume@lelarge.info> wrote:
On Tue, 2012-07-17 at 09:44 -0500, Michael Shapiro wrote:
> I am looking for the ability to search the schema. I'd like to be able to
> see, for example, where a particular string occurs in a function or a view
> or table (or perhaps other objects). Right now I am forced to dump the
> schema and then search outside PgAdmin.
>
> So, I guess, I am asking for such a feature to be added to PgAdmin.

pgAdmin 1.16 (right now in beta) gives you the ability to search for
objects' names that contain a specific string. But I guess it doesn't go
as far as you want, does it?


--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com




Re: Search the schema

From
Guillaume Lelarge
Date:
On Tue, 2012-07-17 at 10:18 -0700, Francisco Leovey wrote:
> Do a backup in sql mode (not compressed) and load the output to a text
> editor. 
> There you can find anything you need.
>  

That's what he does already.


-- 
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com



Re: Search the schema

From
Guillaume Lelarge
Date:
On Tue, 2012-07-17 at 10:59 -0500, Michael Shapiro wrote:
> No, it doesn't.
> 
> For example, I want to see if a given string is used within a function.
> I want to be able to see all the uses of a function: in other functions, in
> select stmts in views, etc.
> 

That won't do it. First time I hear someone needs this.


-- 
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com



Re: Search the schema

From
Fernando Hevia
Date:


On Tue, Jul 17, 2012 at 3:52 PM, Guillaume Lelarge <guillaume@lelarge.info> wrote:
On Tue, 2012-07-17 at 10:59 -0500, Michael Shapiro wrote:
> No, it doesn't.
>
> For example, I want to see if a given string is used within a function.
> I want to be able to see all the uses of a function: in other functions, in
> select stmts in views, etc.
>

That won't do it. First time I hear someone needs this.

I think that would be a pretty cool feature. As someone who programs extensively on pgplsql I have faced the same need more than a few times.
Of course you will be better off keeping your pgplsql code in some versioning system and do the searches there.


Re: Search the schema

From
Michael Shapiro
Date:
I do keep the code in a versioning system. And that is a big help. But that doesn't solve the problem of what is actually installed. Searching the schema would be a big help.

On Tue, Jul 17, 2012 at 3:41 PM, Fernando Hevia <fhevia@gmail.com> wrote:


On Tue, Jul 17, 2012 at 3:52 PM, Guillaume Lelarge <guillaume@lelarge.info> wrote:
On Tue, 2012-07-17 at 10:59 -0500, Michael Shapiro wrote:
> No, it doesn't.
>
> For example, I want to see if a given string is used within a function.
> I want to be able to see all the uses of a function: in other functions, in
> select stmts in views, etc.
>

That won't do it. First time I hear someone needs this.

I think that would be a pretty cool feature. As someone who programs extensively on pgplsql I have faced the same need more than a few times.
Of course you will be better off keeping your pgplsql code in some versioning system and do the searches there.



Re: Search the schema

From
Michal Kozusznik
Date:
Dne 17.7.2012 20:52, Guillaume Lelarge napsal(a):
> On Tue, 2012-07-17 at 10:59 -0500, Michael Shapiro wrote:
>> No, it doesn't.
>>
>> For example, I want to see if a given string is used within a function.
>> I want to be able to see all the uses of a function: in other functions, in
>> select stmts in views, etc.
>>
> That won't do it. First time I hear someone needs this.
>
>

I do also :)
Using dump file as workaround.


Re: Search the schema

From
Guillaume Lelarge
Date:
On Tue, 2012-07-17 at 20:52 +0200, Guillaume Lelarge wrote:
> On Tue, 2012-07-17 at 10:59 -0500, Michael Shapiro wrote:
> > No, it doesn't.
> > 
> > For example, I want to see if a given string is used within a function.
> > I want to be able to see all the uses of a function: in other functions, in
> > select stmts in views, etc.
> > 
> 
> That won't do it. First time I hear someone needs this.
> 

OK then. I added a ticket to work on this. I already wanted to add
search inside comments, I'll have to work also on source code
(functions, views).


-- 
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com



Re: Search the schema

From
Michael Shapiro
Date:
What motivated me to ask for this feature was that I was looking to see if the dependents/dependencies tabs
on function would show all the objects that use the function and the objects that the functions uses, including other functions, views, etc.
Those relationships, I realize, are not explicitly maintained by Postgres, but if PgAdmin could emulate that, it would be great.
But probably hard, so the search was the next best thing.

Given that functions have multiple signatures (same function name with a variable number of args), I'd like to be able to find all the places
that one variant of the function is used. For example if there is a function A with two variants: A(int,int) and A(int, text) -- I'd like to be able to see where
A(int, text) is used.



On Tue, Jul 17, 2012 at 10:59 AM, Michael Shapiro <mshapiro51@gmail.com> wrote:
No, it doesn't.

For example, I want to see if a given string is used within a function.
I want to be able to see all the uses of a function: in other functions, in select stmts in views, etc.




On Tue, Jul 17, 2012 at 10:39 AM, Guillaume Lelarge <guillaume@lelarge.info> wrote:
On Tue, 2012-07-17 at 09:44 -0500, Michael Shapiro wrote:
> I am looking for the ability to search the schema. I'd like to be able to
> see, for example, where a particular string occurs in a function or a view
> or table (or perhaps other objects). Right now I am forced to dump the
> schema and then search outside PgAdmin.
>
> So, I guess, I am asking for such a feature to be added to PgAdmin.

pgAdmin 1.16 (right now in beta) gives you the ability to search for
objects' names that contain a specific string. But I guess it doesn't go
as far as you want, does it?


--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com



Re: Search the schema

From
Guillaume Lelarge
Date:
On Wed, 2012-07-18 at 21:47 -0500, Michael Shapiro wrote:
> What motivated me to ask for this feature was that I was looking to
> see if the dependents/dependencies tabs
> on function would show all the objects that use the function and the
> objects that the functions uses, including other functions, views,
> etc.
> Those relationships, I realize, are not explicitly maintained by
> Postgres, but if PgAdmin could emulate that, it would be great. 
> But probably hard, so the search was the next best thing. 
> 

Hard is not the issue. The dependents/depencies tabs are for
dependencies as given by PostgreSQL. It won't change.

> Given that functions have multiple signatures (same function name with
> a variable number of args), I'd like to be able to find all the places
> that one variant of the function is used. For example if there is a
> function A with two variants: A(int,int) and A(int, text) -- I'd like
> to be able to see where 
> A(int, text) is used.
> 

That won't happen. It's too complicated. What I can do is search for a
specific string.  Begin able to check if A(int, int) is used in this
function, but not function A(int, text) means we need to add something
that will understand the PL/pgsql code. I won't work on that. You can if
you want, but I won't.

The idea I want to work on is to search specific string in a source
code, that's all.


-- 
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com



Re: Search the schema

From
Michael Shapiro
Date:
Of course, makes sense, which is why I made the feature request I did (ie, search). Would you consider adding regex
expressionsto the search?<br /><br /><div class="gmail_quote">On Thu, Jul 19, 2012 at 3:13 AM, Guillaume Lelarge <span
dir="ltr"><<ahref="mailto:guillaume@lelarge.info" target="_blank">guillaume@lelarge.info</a>></span> wrote:<br
/><blockquoteclass="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div
class="im">OnWed, 2012-07-18 at 21:47 -0500, Michael Shapiro wrote:<br /> > What motivated me to ask for this
featurewas that I was looking to<br /> > see if the dependents/dependencies tabs<br /> > on function would show
allthe objects that use the function and the<br /> > objects that the functions uses, including other functions,
views,<br/> > etc.<br /> > Those relationships, I realize, are not explicitly maintained by<br /> > Postgres,
butif PgAdmin could emulate that, it would be great.<br /> > But probably hard, so the search was the next best
thing.<br/> ><br /><br /></div>Hard is not the issue. The dependents/depencies tabs are for<br /> dependencies as
givenby PostgreSQL. It won't change.<br /><div class="im"><br /> > Given that functions have multiple signatures
(samefunction name with<br /> > a variable number of args), I'd like to be able to find all the places<br /> >
thatone variant of the function is used. For example if there is a<br /> > function A with two variants: A(int,int)
andA(int, text) -- I'd like<br /> > to be able to see where<br /> > A(int, text) is used.<br /> ><br /><br
/></div>Thatwon't happen. It's too complicated. What I can do is search for a<br /> specific string.  Begin able to
checkif A(int, int) is used in this<br /> function, but not function A(int, text) means we need to add something<br />
thatwill understand the PL/pgsql code. I won't work on that. You can if<br /> you want, but I won't.<br /><br /> The
ideaI want to work on is to search specific string in a source<br /> code, that's all.<br /><div class="HOEnZb"><div
class="h5"><br/><br /> --<br /> Guillaume<br /><a href="http://blog.guillaume.lelarge.info"
target="_blank">http://blog.guillaume.lelarge.info</a><br/><a href="http://www.dalibo.com"
target="_blank">http://www.dalibo.com</a><br/><br /></div></div></blockquote></div><br /> 

Re: Search the schema

From
Guillaume Lelarge
Date:
On Thu, 2012-07-19 at 05:40 -0500, Michael Shapiro wrote:
> Of course, makes sense, which is why I made the feature request I did
> (ie, search). Would you consider adding regex expressions to the
> search?
> 

Well, it wouldn't be hard to do because the search is done by
PostgreSQL. So we can use PostgreSQL regular expressions.


-- 
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com