Re: [GENERAL] Stored procedures and schema renames

2014-04-22 Thread Florian Weimer
On 04/10/2014 03:29 PM, Rob Sargent wrote: Code for db functions should be a repository. Easy edit and rerun Well, not necessarily inside the transaction that renames the schema. I've settled for this inside the transaction (running as a superuser): UPDATE pg_proc SET proconfig =

[GENERAL] Stored procedures and schema renames

2014-04-10 Thread Florian Weimer
I would like to rename schemas without breaking the stored procedures in them. Currently, this does not work if the stored procedure definition contains a schema self-reference because that does not get renamed. I tried SET search_path FROM CURRENT, but that seems to expand the search path

Re: [GENERAL] Stored procedures and schema renames

2014-04-10 Thread Rob Sargent
Code for db functions should be a repository. Easy edit and rerun Sent from my iPhone On Apr 10, 2014, at 6:19 AM, Florian Weimer fwei...@redhat.com wrote: I would like to rename schemas without breaking the stored procedures in them. Currently, this does not work if the stored procedure

[GENERAL] stored procedures (packages)

2011-09-30 Thread J.V.
I need to run a series of stored procedures, what is the best way to organize and run. Ideally would like something like Oracle PL/SQL where I can put all methods in one file and create a main() method then just : select main() to have them all run. If there is a way to do this, please let

Re: [GENERAL] stored procedures (packages)

2011-09-30 Thread John R Pierce
On 09/30/11 12:57 AM, J.V. wrote: I need to run a series of stored procedures, what is the best way to organize and run. Ideally would like something like Oracle PL/SQL where I can put all methods in one file and create a main() method then just : select main() to have them all run. in

Re: [GENERAL] stored procedures (packages)

2011-09-30 Thread Albe Laurenz
J.V. wrote: I need to run a series of stored procedures, what is the best way to organize and run. Ideally would like something like Oracle PL/SQL where I can put all methods in one file and create a main() method then just : select main() to have them all run. If there is a way to do

Re: [GENERAL] Stored procedures in C

2008-04-24 Thread Emiliano Moscato
Thanks a lot for the response Andrej! One of these texts was known for me. But all of them are VERY basic. No one explains how to do a query and manage results :( The only one that manage querys is the source code placed at contrib/tablefunc in the Postgres distribution. But is VERY hard to

Re: [GENERAL] Stored procedures in C

2008-04-24 Thread Martin Gainty
@postgresql.org Sent: Thursday, April 24, 2008 8:44 AM Subject: Re: [GENERAL] Stored procedures in C Thanks a lot for the response Andrej! One of these texts was known for me. But all of them are VERY basic. No one explains how to do a query and manage results :( The only one

Re: [GENERAL] Stored procedures in C

2008-04-24 Thread Merlin Moncure
On Wed, Apr 23, 2008 at 6:38 PM, Martin Gainty [EMAIL PROTECTED] wrote: Emiliano and Mike The real challenge is trying to determine what a datatype is in cobol..for that matter what is stack variable or heap in Cobol? In the end you're better off rewriting this mess (preferably in Java)..

Re: [GENERAL] Stored procedures in C

2008-04-24 Thread Emiliano Moscato
Guys, it has nothing to do with my question :D I don't know why Martin answer to me anything about Cobol. I just was looking how to query database in a stored procedure in C. Some people pointed me to SPI documentation (at chapter 41 of oficial Postgres documentation) that is being useful. Thanks

[GENERAL] Stored procedures in C

2008-04-23 Thread Emiliano Moscato
Hi all, I have to do some stuff writing stored procedures for Postgres in C. I saw the oficial documentation but it was hard for me to find out how to do a simple function, let's call it query() , that receives a string and uses this string to do a query and return the results. Has anyone some

Re: [GENERAL] Stored procedures in C

2008-04-23 Thread Martin Gainty
then later rewrite to Java (That should get you at least 2 weeks worth of work..) Buena Suerte/Good Luck Martin - Original Message - From: Emiliano Moscato To: pgsql-general@postgresql.org Sent: Wednesday, April 23, 2008 3:32 PM Subject: [GENERAL] Stored procedures in C Hi all

Re: [GENERAL] Stored procedures in C

2008-04-23 Thread Andrej Ricnik-Bay
On 24/04/2008, Emiliano Moscato [EMAIL PROTECTED] wrote: I have to do some stuff writing stored procedures for Postgres in C. I saw the oficial documentation but it was hard for me to find out how to do a simple function, let's call it query() , that receives a string and uses this string to

Re: [GENERAL] Stored procedures when and how: was: Sun acquires MySQL

2008-01-22 Thread Merlin Moncure
On Jan 22, 2008 2:24 AM, Ivan Sergio Borgonovo [EMAIL PROTECTED] wrote: I doubt that what you were measuring there was either procedure call overhead or java computational speed; more likely it was the cost of calling back out of java, through pl/java's JDBC emulation, down through

Re: [GENERAL] Stored procedures when and how: was: Sun acquires MySQL

2008-01-22 Thread Pavel Stehule
Yep, the more I read, the more I get confused. Java loading overhead is a common myth (I can't say if true or false), and what Tom writes above can find a tentative place in my mind. But still then I can't understand where plsql should or shouldn't be used. I really would enjoy to see some

Re: [GENERAL] Stored procedures when and how: was: Sun acquires MySQL

2008-01-22 Thread brian
Pavel Stehule wrote: ... bottleneck is in repeated assign s := s || .. I will try trick: create or replace function list(int) returns varchar as $$ begin return array_to_string(array(select 'item' || i || '/item' from generate_series(1, $1) g(i)), ''); end$$ language plpgsql

[GENERAL] Stored procedures when and how: was: Sun acquires MySQL

2008-01-21 Thread Ivan Sergio Borgonovo
On Mon, 21 Jan 2008 21:31:23 -0800 johnf [EMAIL PROTECTED] wrote: On Monday 21 January 2008 04:47:40 pm Tom Lane wrote: I doubt that what you were measuring there was either procedure call overhead or java computational speed; more likely it was the cost of calling back out of java,

Re: [GENERAL] stored procedures and dynamic queries

2007-12-04 Thread Richard Huxton
Ivan Sergio Borgonovo wrote: On Mon, 03 Dec 2007 19:06:29 + Richard Huxton [EMAIL PROTECTED] wrote: Ivan Sergio Borgonovo wrote: Any general rule about dynamically generated queries in stored procedures vs. performances? It's the same decision as any with any prepared plan vs

Re: [GENERAL] stored procedures and dynamic queries

2007-12-04 Thread Ivan Sergio Borgonovo
On Tue, 04 Dec 2007 08:14:56 + Richard Huxton [EMAIL PROTECTED] wrote: Unless it's an obvious decision (millions of small identical queries vs. occasional large complex ones) then you'll have to test. That's going to be true of any decision like this on any system. :( I'm trying to

Re: [GENERAL] stored procedures and dynamic queries

2007-12-04 Thread Richard Huxton
Ivan Sergio Borgonovo wrote: On Tue, 04 Dec 2007 08:14:56 + Richard Huxton [EMAIL PROTECTED] wrote: Unless it's an obvious decision (millions of small identical queries vs. occasional large complex ones) then you'll have to test. That's going to be true of any decision like this on any

Re: [GENERAL] stored procedures and dynamic queries

2007-12-04 Thread Ted Byers
--- Richard Huxton [EMAIL PROTECTED] wrote: Ivan Sergio Borgonovo wrote: On Tue, 04 Dec 2007 08:14:56 + Richard Huxton [EMAIL PROTECTED] wrote: Unless it's an obvious decision (millions of small identical queries vs. occasional large complex ones) then you'll have to test.

Re: [GENERAL] stored procedures and dynamic queries

2007-12-04 Thread Ivan Sergio Borgonovo
On Tue, 04 Dec 2007 13:54:15 + Richard Huxton [EMAIL PROTECTED] wrote: Always go for the cleaner design. If it turns out that isn't fast enough, *then* start worrying about having a bad but faster design. mmm yeah right. I did express myself badly. What I mean I've first to know what are

Re: [GENERAL] stored procedures and dynamic queries

2007-12-04 Thread Obe, Regina
Sent: Tuesday, December 04, 2007 9:59 AM To: Richard Huxton; Ivan Sergio Borgonovo Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] stored procedures and dynamic queries --- Richard Huxton [EMAIL PROTECTED] wrote: Ivan Sergio Borgonovo wrote: On Tue, 04 Dec 2007 08:14:56 + Richard

[GENERAL] stored procedures and dynamic queries

2007-12-03 Thread Ivan Sergio Borgonovo
Any general rule about dynamically generated queries in stored procedures vs. performances? I was going to write stuff as simple as create or replace function EditQty(int, int, int, varchar(10)) returns boolean as ' declare _uid alias for $1; _aid alias for $2; _qty

Re: [GENERAL] stored procedures and dynamic queries

2007-12-03 Thread Richard Huxton
Ivan Sergio Borgonovo wrote: Any general rule about dynamically generated queries in stored procedures vs. performances? It's the same decision as any with any prepared plan vs plan-each-time trade-off. A query built using EXECUTE will have to be planned each time. That costs you something

Re: [GENERAL] stored procedures and dynamic queries

2007-12-03 Thread Ivan Sergio Borgonovo
On Mon, 03 Dec 2007 19:06:29 + Richard Huxton [EMAIL PROTECTED] wrote: Ivan Sergio Borgonovo wrote: Any general rule about dynamically generated queries in stored procedures vs. performances? It's the same decision as any with any prepared plan vs plan-each-time trade-off. Should I

[GENERAL] Stored Procedures vs Dynamic SQL generated by ORM ?

2007-11-27 Thread Alagu Madhu
Hi All, Which is the best Stored Procedures or Dynamic SQL generated by ORM ? Thanks Madhu Alagu ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Stored Procedures vs Dynamic SQL generated by ORM ?

2007-11-27 Thread Scott Marlowe
On Nov 27, 2007 1:57 AM, Alagu Madhu [EMAIL PROTECTED] wrote: Which is the best Stored Procedures or Dynamic SQL generated by ORM ? Depends on what you mean by best. Dynamic SQL costs more in the planning stage because the db has to plan out each statement before running it. However, it can

Re: [GENERAL] Stored Procedures vs Dynamic SQL generated by ORM ?

2007-11-27 Thread Andrew Sullivan
On Mon, Nov 26, 2007 at 11:57:37PM -0800, Alagu Madhu wrote: Which is the best Stored Procedures or Dynamic SQL generated by ORM ? This is roughly similar to the question, Is it better to travel by car, boat, or plane? It rather depends on what you're trying to accomplish. A -- Andrew

Re: [GENERAL] Stored Procedures and Functions

2007-06-04 Thread Albe Laurenz
Harpreet Dhaliwal wrote: Is it true that postgres doesn't have a notion of Stored Procedures and functions is what it has instead? RDBMS like Sql Server supports both stored procedures and functions. So I was wondering what is the difference between a Stored Procedure and a function. I

[GENERAL] Stored Procedures and Functions

2007-06-02 Thread Harpreet Dhaliwal
Hi, Is it true that postgres doesn't have a notion of Stored Procedures and functions is what it has instead? RDBMS like Sql Server supports both stored procedures and functions. So I was wondering what is the difference between a Stored Procedure and a function. Thanks, ~Harpreet

Re: [GENERAL] Stored Procedures and Functions

2007-06-02 Thread Leif B. Kristensen
On Saturday 2. June 2007 16:47, Harpreet Dhaliwal wrote: Hi, Is it true that postgres doesn't have a notion of Stored Procedures and functions is what it has instead? RDBMS like Sql Server supports both stored procedures and functions. So I was wondering what is the difference between a Stored

Re: [GENERAL] Stored Procedures and Functions

2007-06-02 Thread Pavel Stehule
Hello Is it true that postgres doesn't have a notion of Stored Procedures and functions is what it has instead? RDBMS like Sql Server supports both stored procedures and functions. So I was wondering what is the difference between a Stored Procedure and a function. It's true. PostgreSQL

Re: [GENERAL] Stored Procedures and Functions

2007-06-02 Thread PFC
MySQL supports procedures and functions. Functions can return results but cannot update the database. Procedures can update the database but cannot return results. However : - a function can call a procedure that updates the database ! - a

[GENERAL] Stored Procedures Performance: Java vs. PL/Pgsql

2007-05-28 Thread Daniel Kastenholz
Hi, is there a rule of thumb or an estimate which language provides the best performance for stored procedures? I'm currently using PL/Pgsql, and wondering - to what extent these stored procedures are actually precompiled and/or optimized - if Java might provide better performance, or if

Re: [GENERAL] Stored Procedures Performance: Java vs. PL/Pgsql

2007-05-28 Thread Chris Browne
[EMAIL PROTECTED] (Daniel Kastenholz) writes: Hi, is there a rule of thumb or an estimate which language provides the best performance for stored procedures? I'm currently using PL/Pgsql, and wondering - to what extent these stored procedures are actually precompiled and/or optimized - if

Re: [GENERAL] stored procedures

2006-07-05 Thread hubert depesz lubaczewski
On 6/30/06, Alain Roger [EMAIL PROTECTED] wrote: i'm migrating some SP from MySQL to PostgreSQL 8.1.xI would like to know if it is possible to return aresult of a select request and also a simple interger...that's definitelly possible (and by the way - is was possi ble years before mysql

[GENERAL] stored procedures

2006-06-30 Thread Alain Roger
Hi,i'm migrating some SP from MySQL to PostgreSQL 8.1.xI would like to know if it is possible to return aresult of a select request and also a simple interger...thanks a lot,Alain

[GENERAL] Stored procedures..PLEASE HELP

2006-01-17 Thread Minal A. Aryamane
hello all, I desparately need help in developing stored procedure using postgresql 8.0. I am using pgadmin for developing the stored procs. Can anyone please help me, The docs are really not helpful. am trying to pass values through a jsp page wherein I am accessing this stored procedures

Re: [GENERAL] Stored procedures..PLEASE HELP

2006-01-17 Thread Richard Huxton
Minal A. Aryamane wrote: hello all, I desparately need help in developing stored procedure using postgresql 8.0. I am using pgadmin for developing the stored procs. Can anyone please help me, The docs are really not helpful. am trying to pass values through a jsp page wherein I am accessing

Re: [GENERAL] Stored procedures..PLEASE HELP

2006-01-17 Thread Alagu Madhu
Hello, I am alagu madhu working as a Developer (postgresql).pls,send your table design. Minal A. Aryamane wrote: hello all, I desparately need help in developing stored procedure using postgresql 8.0. I am using pgadmin for developing the stored procs. Can anyone please help

[GENERAL] Stored Procedures for Security

2005-07-19 Thread Alex Stapleton
What is everyone's opinion for exclusively using Stored Procedures for increased security? The scenario I am thinking of means having one user which is widely accessible (large numbers of staff/user for example) and only has access to some stored procedures, which where create with

[GENERAL] stored procedures / C-Language

2005-04-04 Thread FERREIRA William (COFRAMI)
Title: stored procedures / C-Language hi, i'm trying to find some documentation about writing stored procedures with C-language. i found description in postgresql's documentation but i don't understand everything. Aat present, i have a pl/perl stored procedure but it isn't fast enough, so

Re: [GENERAL] stored procedures / C-Language

2005-04-04 Thread Magnus Hagander
Title: stored procedures / C-Language hi, i'm trying to find some documentation about writing stored procedures with C-language. i found description in postgresql's documentation but i don't understand everything. Aat present, i have a pl/perl stored procedure but it isn't

[GENERAL] Stored Procedures

2004-09-21 Thread Kent Anderson
We are currently switching to stored procedures for a lot of our database activity. The question has come up about the transactional nature of the stored procedures. I was wondering if stored procedures can have transactions in themor if you must start the transaction in your code and call

Re: [GENERAL] Stored Procedures

2004-09-21 Thread Alvaro Herrera
On Tue, Sep 21, 2004 at 07:41:31AM -0400, Kent Anderson wrote: We are currently switching to stored procedures for a lot of our database activity. The question has come up about the transactional nature of the stored procedures. I was wondering if stored procedures can have transactions in

Re: [GENERAL] Stored Procedures

2004-09-21 Thread Alvaro Herrera
On Tue, Sep 21, 2004 at 11:11:33AM -0700, Chris Travers wrote: Alvaro Herrera wrote: There's only one transaction (whether it's an explicit transaction block or an implicit one), and the query that invokes the stored procedure is already running inside it. So the stored procedure always has

[GENERAL] Stored Procedures woes

2004-08-19 Thread Andrew Hall
Hello, We are using a number of stored procedures that are called often from our client programs. I include one here as an example. The problem we are seeing is that when executing some of these that deal with a large number of records, they begin execution and never return. The process handling

Re: [GENERAL] Stored Procedures woes

2004-08-19 Thread Oliver Elphick
On Thu, 2004-08-19 at 10:53, Andrew Hall wrote: Hello, We are using a number of stored procedures that are called often from our client programs. I include one here as an example. The problem we are seeing is that when executing some of these that deal with a large number of records, they

Re: [GENERAL] Stored Procedures woes

2004-08-19 Thread Tom Lane
Oliver Elphick [EMAIL PROTECTED] writes: We are using a number of stored procedures that are called often from our client programs. Are you somehow setting off an infinite recursion? How is this being called? I doubt it would be an infinite-recursion problem, as that would soon lead to

[GENERAL] Stored procedures

2004-08-02 Thread Secrétariat
Hello ! My ODBC driver in MS Visual Basic 6 refers also to "Stored procedures" asRecord source. What are these stored procedures, I don't find anything in the 7.4 documentation, Where can I find documentation ? Many thanks. Luc

[GENERAL] Stored procedures output variables

2004-04-14 Thread Shachar Shemesh
Hi List, How do I define a stored procedure that has an output variable? I am looking for a way that will not significantly change the way the argument is called. Can I, for example, pass a reference to variable in some way? Shachar -- Shachar Shemesh Lingnu Open Source

Re: [GENERAL] Stored procedures output variables

2004-04-14 Thread Bill Moran
Shachar Shemesh wrote: Hi List, How do I define a stored procedure that has an output variable? I am looking for a way that will not significantly change the way the argument is called. Can I, for example, pass a reference to variable in some way? If I understand your question, the best way is

[GENERAL] Stored procedures from MS Query

2003-10-28 Thread Tomas Larsson
Hi! We're trying to call a set-returning stored procedure from Excel (MS Query). To do this we type: select * from getStudents() (where getStudents() is the stored procedure). The problem is that MS Query interprets this as if getStudents was a table, and complains that there is no table called

Re: [GENERAL] Stored procedures from MS Query

2003-10-28 Thread Tomas Larsson
Thanks Shridhar! Works like a charm! /tomas, Patrik and Siv. --- Shridhar Daithankar [EMAIL PROTECTED] wrote: On Tuesday 28 October 2003 16:06, Tomas Larsson wrote: Hi! We're trying to call a set-returning stored procedure from Excel (MS Query). Create a dummy table and a rule

Re: [GENERAL] Stored procedures from MS Query

2003-10-28 Thread Shridhar Daithankar
On Tuesday 28 October 2003 16:06, Tomas Larsson wrote: Hi! We're trying to call a set-returning stored procedure from Excel (MS Query). To do this we type: select * from getStudents() (where getStudents() is the stored procedure). The problem is that MS Query interprets this as if

[GENERAL] stored procedures

2001-05-03 Thread Alexander Lohse
Hi, I am very new to PgSQL and I am just trying to figure out what for to use stored procedures. What I read/tested up to now is that pl/pgsql seems to be a bit clumsy to write. Possibly needing a lot of trial error. So, I am not really sure what is the benefit of writing logic inside the

[GENERAL] Stored Procedures

2000-09-07 Thread Andreas Tille
Hello after playing around for a while with PostgreSQL's Stored Functions I think I understood the concept behind it a little bit. It is mighty but quite different from all other SQL servers Stored Procedures. Considering the fact that there is another OpenSourced SQL database engine Interbase,

[GENERAL] Stored procedures returning multiple values... ?

2000-02-25 Thread Henrique Pantarotto
Hello friends, many months ago I starting messing with stored procedures with PostgreSQL, and at the time, I found out that I could only return "one" value when I used a stored procedure. I was wondering if this has changed or has/will/could be changed/implemented with PostgreSQL 7.0? It would

[GENERAL] stored procedures

1999-08-30 Thread Matthew Hixson
Could someone point me to a tutorial or HOWTO regarding stored procedures? I know very little about them and need to learn everything I possibly can about them as soon as possible. I looked throught the Postgres docs and couldn't find anything that goes into them in depth. Thank you, -M@

[GENERAL] Stored Procedures

1999-01-03 Thread Jeff MacDonald
Greets, Couple of questions, 1: does postgres support stored procedures 2: say a user has a microsoft sql server 7 database with ~120 stored procedures, and alot of data, is their a script or tool to convert that to a postgres database or does it have to

Re: [GENERAL] Stored Procedures

1999-01-03 Thread Brett W. McCoy
On Fri, 5 Nov 1999, Jeff MacDonald wrote: 1: does postgres support stored procedures Yes, quite extensively, and far beyond what SQL 7 offers. You may want to take a look at the programmer's manual for the documentation. 2: say a user has a microsoft sql server 7 database