vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I'm writing some stored procedures in pl/pgsql for a database using postgresql 7.4.7. I need to write a complex function with 65 arguments, but when I try to run it I get an error complaining that arguments can be up to 32. Is there a way to solve this problem or do I have to try to split the function into three new ones? -- Non c'e' piu' forza nella normalita', c'e' solo monotonia. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFQOpjogx/KbFcCAoRAm/1AJ49/BkoQgY4DsSk692hbnVKJHK3PwCdENqz v3CqqiPV3AScsldFHDjM/44= =rK6U -----END PGP SIGNATURE----- |
| |||
| Put them in arrays and pass them as the arguments. But, I would like to know what function could ever need 65 arguments? Ottavio Campana wrote: > I'm writing some stored procedures in pl/pgsql for a database using > postgresql 7.4.7. > > I need to write a complex function with 65 arguments, but when I try to > run it I get an error complaining that arguments can be up to 32. > > Is there a way to solve this problem or do I have to try to split the > function into three new ones? > > -- erik jones <erik@myemma.com> software development emma(r) ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster |
| |||
| Create a type whith the fields?! Ex.: Create type myType as (field1 integer, field2 integer, ...); Create or replace function func_type(myType) returns integer AS $$ DECLARE param ALIAS FOR $1; BEGIN RAISE LOG 'Param fields: %, %, %, ... ', param.field1, param.field2, ...; END; $$ LANGUAGE plpgsql; 2006/10/26, Ottavio Campana <ottavio@campana.vi.it>: > > I'm writing some stored procedures in pl/pgsql for a database using > postgresql 7.4.7. > > I need to write a complex function with 65 arguments, but when I try to > run it I get an error complaining that arguments can be up to 32. > > Is there a way to solve this problem or do I have to try to split the > function into three new ones? > > -- > Non c'e' piu' forza nella normalita', c'e' solo monotonia. > > > > -- William Leite Araújo |
| |||
| On Oct 26 10:03, Ottavio Campana wrote: > I'm writing some stored procedures in pl/pgsql for a database using > postgresql 7.4.7. > > I need to write a complex function with 65 arguments, but when I try to > run it I get an error complaining that arguments can be up to 32. > > Is there a way to solve this problem or do I have to try to split the > function into three new ones? Why don't you use a record (or array) type instead? Regards. ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq |
| |||
| Erik Jones wrote: > Put them in arrays and pass them as the arguments. But, I would like to > know what function could ever need 65 arguments? Consider that I have to invoke the function from a ZSQL method in zope. Do you know if it works? I need all these arguments because we have a tables where we store items for an e-commerce site. The problem is that these items might have a lot of peculiarities and more than 40 fields are boolean to fully describe them. Bye > Ottavio Campana wrote: >> I'm writing some stored procedures in pl/pgsql for a database using >> postgresql 7.4.7. >> >> I need to write a complex function with 65 arguments, but when I try to >> run it I get an error complaining that arguments can be up to 32. >> >> Is there a way to solve this problem or do I have to try to split the >> function into three new ones? >> >> > > -- Non c'e' piu' forza nella normalita', c'e' solo monotonia. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFQPaNogx/KbFcCAoRAhRYAJsGDq+3fdabH/mYNvj/K8k1PZbDmgCfakwo Zjswx/bpOE26IZldJ+3sd50= =zdQH -----END PGP SIGNATURE----- |
| |||
| On Oct 26 10:55, Ottavio Campana wrote: > Erik Jones wrote: > > Put them in arrays and pass them as the arguments. But, I would like to > > know what function could ever need 65 arguments? > > Consider that I have to invoke the function from a ZSQL method in zope. > Do you know if it works? > > I need all these arguments because we have a tables where we store items > for an e-commerce site. The problem is that these items might have a > lot of peculiarities and more than 40 fields are boolean to fully > describe them. I don't have a clue about the ZSQL issue, but it can be a solution to OR those booleans, with some bitwise logic. Regards. ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster |
| |||
| On Thu, Oct 26, 2006 at 10:03:27AM -0700, Ottavio Campana wrote: > I'm writing some stored procedures in pl/pgsql for a database using > postgresql 7.4.7. > > I need to write a complex function with 65 arguments, but when I try > to run it I get an error complaining that arguments can be up to 32. > > Is there a way to solve this problem or do I have to try to split > the function into three new ones? You can pass the function one complex type that has as many parts as you like. Or several complex types if that makes more sense. Cheers, D -- David Fetter <david@fetter.org> http://fetter.org/ phone: +1 415 235 3778 AIM: dfetter666 Skype: davidfetter Remember to vote! ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq |
| |||
| Ottavio Campana <ottavio@campana.vi.it> writes: > I'm writing some stored procedures in pl/pgsql for a database using > postgresql 7.4.7. > I need to write a complex function with 65 arguments, but when I try to > run it I get an error complaining that arguments can be up to 32. Update to 8.1, which allows 100 by default. Or modify FUNC_MAX_ARGS and recompile --- but be aware that in 7.4.x that change requires an initdb. Or, as suggested elsewhere, rethink that function's API. A list of 65 arguments seems terribly error-prone to me... regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly |
| |||
| I just implemented the same function using an array holding all the booleans fields describing the objects. It works well. Thank you to all of you. -- Non c'e' piu' forza nella normalita', c'e' solo monotonia. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFQRCnogx/KbFcCAoRAg+JAJ42H5pdD6k6YIVBqzfJTCws5vkm2QCeLbvf G3UrsvLDYSkscP170kIMYsY= =zP8K -----END PGP SIGNATURE----- |
| ||||
| Ottavio Campana schrieb: > Erik Jones wrote: >> Put them in arrays and pass them as the arguments. But, I would like to >> know what function could ever need 65 arguments? > > Consider that I have to invoke the function from a ZSQL method in zope. > Do you know if it works? > > I need all these arguments because we have a tables where we store items > for an e-commerce site. The problem is that these items might have a > lot of peculiarities and more than 40 fields are boolean to fully > describe them. you mean item description? Why would you update them all? Or what are you doing w/ it? If its kinda search for products, you wont need more then about 6 different attributes to choose from the same time. thats attribute name + desired value = 12 params at best. Otherwise could you give an example usage of that more then 32 values call? Regards Tino ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster |