dbTalk Databases Forums  

editing pl/pgsql procedures

comp.databases.postgresql comp.databases.postgresql


Discuss editing pl/pgsql procedures in the comp.databases.postgresql forum.



Reply
 
Thread Tools Display Modes
  #41  
Old   
Andreas Kretschmer
 
Posts: n/a

Default Re: editing pl/pgsql procedures - 11-22-2008 , 08:28 AM






Coniglio Sgabbiato <nobody (AT) nowhere (DOT) it> wrote:
Quote:
Andreas Kretschmer ha scritto:
Another curiosity: is there a way to retrieve the code of an already
existant sp and save it onto a file? I was thinking about to retrieve it
from information schema, I am trying to tinker with things like:
Several solutions:

* use pg_dump and create a schema-only dump. This contains also the
definition for all your functions.

* ask pg_catalog.pg_proc, this contains all informations about functions,
but not in the form for create function. (there are several fields, for
instance for the language, input-paramaters and the source)

* wait for 8.4, it contains a new function pg_get_functiondef().




Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect. (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly." (unknown)
Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889°


Reply With Quote
  #42  
Old   
Coniglio Sgabbiato
 
Posts: n/a

Default Re: editing pl/pgsql procedures - 12-04-2008 , 10:30 AM






Agyaras ha scritto:
Quote:
In article <4926d3a9$0$11378$5fc30a8 (AT) news (DOT) tiscali.it>,
Coniglio Sgabbiato <nobody (AT) nowhere (DOT) it> wrote:

Hi all,
I am new to Postgres and now I am doing some programming in pl/pgsql. At
this moment I am wirting procedures with a text editor and pasting them
on psql commandline via putty (with the annoyance that you cannot paste
more than a certain amount of text, so I have to slice them).
Since I use and enjoy Vim directly from the server vis ssh, I wish to
know if there is a way to create/edit pl/pgsql procedures directly from
Vim. Dou you have a tip?


I recommend PgAdminIII (http://pgadmin.org), an excellent free GUI
client for Postgres. Does everything you need and more.

You can create a SP by filling out a form, specifying function name,
params, return type etc. You can type in the whole function definition
as well, but a simple BEGIN...END; pair is sufficient. Now comes the
cool part. Locate your newly defined function in the object tree,
right-click and select "CREATE script". This opens a window with the
source of your function, beginning with the magic "CREATE OR REPLACE
FUNCTION..." You can edit the definition and then run it as a query:
this stores the new definition in the DB and it is immediately available
for testing.

Much more productive IMHO than the text editor/psql combination.

have fun, Inoshishi

Yes, I already use it sometimes, but I am a commandline-oriented guy...



Reply With Quote
  #43  
Old   
Coniglio Sgabbiato
 
Posts: n/a

Default Re: editing pl/pgsql procedures - 12-04-2008 , 10:30 AM



Agyaras ha scritto:
Quote:
In article <4926d3a9$0$11378$5fc30a8 (AT) news (DOT) tiscali.it>,
Coniglio Sgabbiato <nobody (AT) nowhere (DOT) it> wrote:

Hi all,
I am new to Postgres and now I am doing some programming in pl/pgsql. At
this moment I am wirting procedures with a text editor and pasting them
on psql commandline via putty (with the annoyance that you cannot paste
more than a certain amount of text, so I have to slice them).
Since I use and enjoy Vim directly from the server vis ssh, I wish to
know if there is a way to create/edit pl/pgsql procedures directly from
Vim. Dou you have a tip?


I recommend PgAdminIII (http://pgadmin.org), an excellent free GUI
client for Postgres. Does everything you need and more.

You can create a SP by filling out a form, specifying function name,
params, return type etc. You can type in the whole function definition
as well, but a simple BEGIN...END; pair is sufficient. Now comes the
cool part. Locate your newly defined function in the object tree,
right-click and select "CREATE script". This opens a window with the
source of your function, beginning with the magic "CREATE OR REPLACE
FUNCTION..." You can edit the definition and then run it as a query:
this stores the new definition in the DB and it is immediately available
for testing.

Much more productive IMHO than the text editor/psql combination.

have fun, Inoshishi

Yes, I already use it sometimes, but I am a commandline-oriented guy...



Reply With Quote
  #44  
Old   
Coniglio Sgabbiato
 
Posts: n/a

Default Re: editing pl/pgsql procedures - 12-04-2008 , 10:30 AM



Agyaras ha scritto:
Quote:
In article <4926d3a9$0$11378$5fc30a8 (AT) news (DOT) tiscali.it>,
Coniglio Sgabbiato <nobody (AT) nowhere (DOT) it> wrote:

Hi all,
I am new to Postgres and now I am doing some programming in pl/pgsql. At
this moment I am wirting procedures with a text editor and pasting them
on psql commandline via putty (with the annoyance that you cannot paste
more than a certain amount of text, so I have to slice them).
Since I use and enjoy Vim directly from the server vis ssh, I wish to
know if there is a way to create/edit pl/pgsql procedures directly from
Vim. Dou you have a tip?


I recommend PgAdminIII (http://pgadmin.org), an excellent free GUI
client for Postgres. Does everything you need and more.

You can create a SP by filling out a form, specifying function name,
params, return type etc. You can type in the whole function definition
as well, but a simple BEGIN...END; pair is sufficient. Now comes the
cool part. Locate your newly defined function in the object tree,
right-click and select "CREATE script". This opens a window with the
source of your function, beginning with the magic "CREATE OR REPLACE
FUNCTION..." You can edit the definition and then run it as a query:
this stores the new definition in the DB and it is immediately available
for testing.

Much more productive IMHO than the text editor/psql combination.

have fun, Inoshishi

Yes, I already use it sometimes, but I am a commandline-oriented guy...



Reply With Quote
  #45  
Old   
Coniglio Sgabbiato
 
Posts: n/a

Default Re: editing pl/pgsql procedures - 12-04-2008 , 10:30 AM



Agyaras ha scritto:
Quote:
In article <4926d3a9$0$11378$5fc30a8 (AT) news (DOT) tiscali.it>,
Coniglio Sgabbiato <nobody (AT) nowhere (DOT) it> wrote:

Hi all,
I am new to Postgres and now I am doing some programming in pl/pgsql. At
this moment I am wirting procedures with a text editor and pasting them
on psql commandline via putty (with the annoyance that you cannot paste
more than a certain amount of text, so I have to slice them).
Since I use and enjoy Vim directly from the server vis ssh, I wish to
know if there is a way to create/edit pl/pgsql procedures directly from
Vim. Dou you have a tip?


I recommend PgAdminIII (http://pgadmin.org), an excellent free GUI
client for Postgres. Does everything you need and more.

You can create a SP by filling out a form, specifying function name,
params, return type etc. You can type in the whole function definition
as well, but a simple BEGIN...END; pair is sufficient. Now comes the
cool part. Locate your newly defined function in the object tree,
right-click and select "CREATE script". This opens a window with the
source of your function, beginning with the magic "CREATE OR REPLACE
FUNCTION..." You can edit the definition and then run it as a query:
this stores the new definition in the DB and it is immediately available
for testing.

Much more productive IMHO than the text editor/psql combination.

have fun, Inoshishi

Yes, I already use it sometimes, but I am a commandline-oriented guy...



Reply With Quote
  #46  
Old   
Coniglio Sgabbiato
 
Posts: n/a

Default Re: editing pl/pgsql procedures - 12-04-2008 , 10:30 AM



Agyaras ha scritto:
Quote:
In article <4926d3a9$0$11378$5fc30a8 (AT) news (DOT) tiscali.it>,
Coniglio Sgabbiato <nobody (AT) nowhere (DOT) it> wrote:

Hi all,
I am new to Postgres and now I am doing some programming in pl/pgsql. At
this moment I am wirting procedures with a text editor and pasting them
on psql commandline via putty (with the annoyance that you cannot paste
more than a certain amount of text, so I have to slice them).
Since I use and enjoy Vim directly from the server vis ssh, I wish to
know if there is a way to create/edit pl/pgsql procedures directly from
Vim. Dou you have a tip?


I recommend PgAdminIII (http://pgadmin.org), an excellent free GUI
client for Postgres. Does everything you need and more.

You can create a SP by filling out a form, specifying function name,
params, return type etc. You can type in the whole function definition
as well, but a simple BEGIN...END; pair is sufficient. Now comes the
cool part. Locate your newly defined function in the object tree,
right-click and select "CREATE script". This opens a window with the
source of your function, beginning with the magic "CREATE OR REPLACE
FUNCTION..." You can edit the definition and then run it as a query:
this stores the new definition in the DB and it is immediately available
for testing.

Much more productive IMHO than the text editor/psql combination.

have fun, Inoshishi

Yes, I already use it sometimes, but I am a commandline-oriented guy...



Reply With Quote
  #47  
Old   
Coniglio Sgabbiato
 
Posts: n/a

Default Re: editing pl/pgsql procedures - 12-04-2008 , 10:30 AM



Agyaras ha scritto:
Quote:
In article <4926d3a9$0$11378$5fc30a8 (AT) news (DOT) tiscali.it>,
Coniglio Sgabbiato <nobody (AT) nowhere (DOT) it> wrote:

Hi all,
I am new to Postgres and now I am doing some programming in pl/pgsql. At
this moment I am wirting procedures with a text editor and pasting them
on psql commandline via putty (with the annoyance that you cannot paste
more than a certain amount of text, so I have to slice them).
Since I use and enjoy Vim directly from the server vis ssh, I wish to
know if there is a way to create/edit pl/pgsql procedures directly from
Vim. Dou you have a tip?


I recommend PgAdminIII (http://pgadmin.org), an excellent free GUI
client for Postgres. Does everything you need and more.

You can create a SP by filling out a form, specifying function name,
params, return type etc. You can type in the whole function definition
as well, but a simple BEGIN...END; pair is sufficient. Now comes the
cool part. Locate your newly defined function in the object tree,
right-click and select "CREATE script". This opens a window with the
source of your function, beginning with the magic "CREATE OR REPLACE
FUNCTION..." You can edit the definition and then run it as a query:
this stores the new definition in the DB and it is immediately available
for testing.

Much more productive IMHO than the text editor/psql combination.

have fun, Inoshishi

Yes, I already use it sometimes, but I am a commandline-oriented guy...



Reply With Quote
  #48  
Old   
Coniglio Sgabbiato
 
Posts: n/a

Default Re: editing pl/pgsql procedures - 12-04-2008 , 10:30 AM



Agyaras ha scritto:
Quote:
In article <4926d3a9$0$11378$5fc30a8 (AT) news (DOT) tiscali.it>,
Coniglio Sgabbiato <nobody (AT) nowhere (DOT) it> wrote:

Hi all,
I am new to Postgres and now I am doing some programming in pl/pgsql. At
this moment I am wirting procedures with a text editor and pasting them
on psql commandline via putty (with the annoyance that you cannot paste
more than a certain amount of text, so I have to slice them).
Since I use and enjoy Vim directly from the server vis ssh, I wish to
know if there is a way to create/edit pl/pgsql procedures directly from
Vim. Dou you have a tip?


I recommend PgAdminIII (http://pgadmin.org), an excellent free GUI
client for Postgres. Does everything you need and more.

You can create a SP by filling out a form, specifying function name,
params, return type etc. You can type in the whole function definition
as well, but a simple BEGIN...END; pair is sufficient. Now comes the
cool part. Locate your newly defined function in the object tree,
right-click and select "CREATE script". This opens a window with the
source of your function, beginning with the magic "CREATE OR REPLACE
FUNCTION..." You can edit the definition and then run it as a query:
this stores the new definition in the DB and it is immediately available
for testing.

Much more productive IMHO than the text editor/psql combination.

have fun, Inoshishi

Yes, I already use it sometimes, but I am a commandline-oriented guy...



Reply With Quote
  #49  
Old   
Coniglio Sgabbiato
 
Posts: n/a

Default Re: editing pl/pgsql procedures - 12-04-2008 , 10:30 AM



Agyaras ha scritto:
Quote:
In article <4926d3a9$0$11378$5fc30a8 (AT) news (DOT) tiscali.it>,
Coniglio Sgabbiato <nobody (AT) nowhere (DOT) it> wrote:

Hi all,
I am new to Postgres and now I am doing some programming in pl/pgsql. At
this moment I am wirting procedures with a text editor and pasting them
on psql commandline via putty (with the annoyance that you cannot paste
more than a certain amount of text, so I have to slice them).
Since I use and enjoy Vim directly from the server vis ssh, I wish to
know if there is a way to create/edit pl/pgsql procedures directly from
Vim. Dou you have a tip?


I recommend PgAdminIII (http://pgadmin.org), an excellent free GUI
client for Postgres. Does everything you need and more.

You can create a SP by filling out a form, specifying function name,
params, return type etc. You can type in the whole function definition
as well, but a simple BEGIN...END; pair is sufficient. Now comes the
cool part. Locate your newly defined function in the object tree,
right-click and select "CREATE script". This opens a window with the
source of your function, beginning with the magic "CREATE OR REPLACE
FUNCTION..." You can edit the definition and then run it as a query:
this stores the new definition in the DB and it is immediately available
for testing.

Much more productive IMHO than the text editor/psql combination.

have fun, Inoshishi

Yes, I already use it sometimes, but I am a commandline-oriented guy...



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.