[SQL] i have table
Hi …
I have one table with 12 fields..
CREATE TABLE addition_alteration_memo
(
addition_alteration_memo int8 NOT NULL DEFAULT
nextval('addition_alteration_memo_addition_alteration_memo_seq'::regclass),
cda_no varchar(7) NOT NULL,
week numeric,
sheet_no numeric,
serial_no numeric,
date date,
dr_no varchar,
amount numeric,
memo_no varchar,
memo_date date,
no_instalments numeric,
instalment_rate numeric)
now I want to add one more field in this table.. but that
field has to come next to cda_no.. I mean as a 3rd field.. If I am
adding that field it is coming last field …
may I know how it is possible to that table…
Thanks & Regards
Penchal reddy | Software Engineer
Infinite Computer Solutions | Exciting Times…Infinite Possibilities...
SEI-CMMI level 5 | ISO 9001:2000
IT SERVICES |
BPO
Telecom | Finance
| Healthcare | Manufacturing
| Energy & Utilities | Retail
& Distribution | Government
Tel +91-80-5193-(Ext:503)| Fax +91-80-51930009 | Cell No +91-9980012376|www.infics.com
Information transmitted by this e-mail is
proprietary to Infinite Computer Solutions and/ or its Customers and is
intended for use only by the individual or entity to which it is addressed, and
may contain information that is privileged, confidential or exempt from
disclosure under applicable law. If you are not the intended recipient or it
appears that this mail has been forwarded to you without proper authority, you
are notified that any use or dissemination of this information in any manner is
strictly prohibited. In such cases, please notify us immediately at [EMAIL PROTECTED] and delete this mail from your records.
Information transmitted by this e-mail is proprietary to Infinite Computer Solutions and / or its Customers and is intended for use only by the individual or the entity to which it is addressed, and may contain information that is privileged, confidential or exempt from disclosure under applicable law. If you are not the intended recipient or it appears that this mail has been forwarded to you without proper authority, you are notified that any use or dissemination of this information in any manner is strictly prohibited. In such cases, please notify us immediately at [EMAIL PROTECTED] and delete this email from your records.
Re: [SQL] i have table
am Tue, dem 03.10.2006, um 16:17:30 +0530 mailte Penchalaiah P. folgendes: > now I want to add one more field in this table.. but that field has to come > next to cda_no.. I mean as a 3^rd field.. If I am adding that field it is > coming last field ? Yes. > > may I know how it is possible to that table? IIRC you can't. But you can: - select the columns in the order you need (never do a select * from ...) - create a view with your desired order - create a new table with your desired order > Information transmitted by this e-mail is proprietary to Infinite Computer > Solutions and/ or its Customers and is intended for use only by the individual > ... > > > Information transmitted by this e-mail is proprietary to Infinite Computer > Solutions and / or its Customers and is intended for use only by the > individual > ... Is this realy necessary? Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47215, D1: 0160/7141639 (mehr: -> Header) GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq
Re: [SQL] i have table
Στις Τρίτη 03 Οκτώβριος 2006 13:47, ο/η Penchalaiah P. έγραψε:
> Hi ...
>
> I have one table with 12 fields..
>
>
>
> CREATE TABLE addition_alteration_memo
>
> (
>
> addition_alteration_memo int8 NOT NULL DEFAULT
> nextval('addition_alteration_memo_addition_alteration_memo_seq'::regclas
> s),
>
> cda_no varchar(7) NOT NULL,
>
> week numeric,
>
> sheet_no numeric,
>
> serial_no numeric,
>
> date date,
>
> dr_no varchar,
>
> amount numeric,
>
> memo_no varchar,
>
> memo_date date,
>
> no_instalments numeric,
>
> instalment_rate numeric)
>
>
>
> now I want to add one more field in this table.. but that field has to
> come next to cda_no.. I mean as a 3rd field.. If I am adding that field
> it is coming last field ...
>
> may I know how it is possible to that table...
>
2 notes:
1) Why do you feel that this presentational reordering is important. Normally
it should not be important, otherwise some engineering flaw is hanging
around.
2) If you are sure it is important, one way to do this, is dump, change the
order of the field in the .sql and restore.
>
>
> Thanks & Regards
>
> Penchal reddy | Software Engineer
>
> Infinite Computer Solutions | Exciting Times...Infinite Possibilities...
>
>
> SEI-CMMI level 5 | ISO 9001:2000
>
> IT SERVICES | BPO
>
>
> Telecom | Finance | Healthcare | Manufacturing | Energy & Utilities |
> Retail & Distribution | Government
>
>
> Tel +91-80-5193-(Ext:503)| Fax +91-80-51930009 | Cell No
> +91-9980012376|www.infics.com
>
> Information transmitted by this e-mail is proprietary to Infinite
> Computer Solutions and/ or its Customers and is intended for use only by
> the individual or entity to which it is addressed, and may contain
> information that is privileged, confidential or exempt from disclosure
> under applicable law. If you are not the intended recipient or it
> appears that this mail has been forwarded to you without proper
> authority, you are notified that any use or dissemination of this
> information in any manner is strictly prohibited. In such cases, please
> notify us immediately at [EMAIL PROTECTED] and delete this mail from
> your records.
>
>
>
>
>
> Information transmitted by this e-mail is proprietary to Infinite Computer
> Solutions and / or its Customers and is intended for use only by the
> individual or the entity to which it is addressed, and may contain
> information that is privileged, confidential or exempt from disclosure
> under applicable law. If you are not the intended recipient or it appears
> that this mail has been forwarded to you without proper authority, you are
> notified that any use or dissemination of this information in any manner is
> strictly prohibited. In such cases, please notify us immediately at
> [EMAIL PROTECTED] and delete this email from your records.
--
Achilleas Mantzios
---(end of broadcast)---
TIP 6: explain analyze is your friend
Re: [SQL] How to FindNearest
-Original Message- From: Bruno Wolff III <[EMAIL PROTECTED]> To: Alexander Ilyin <[EMAIL PROTECTED]> Date: Mon, 2 Oct 2006 19:20:49 -0500 Subject: Re: How to FindNearest > On Sat, Sep 30, 2006 at 11:43:40 +0300, > Alexander Ilyin <[EMAIL PROTECTED]> wrote: > > > > Suppose we have huge table. On the screen we need to show contents of that > > table in the Grid and under that Grid user can input in TextBox some > > letters. OnChange of this TextBox we need to make current row selection in > > the Grid on the row with value of some column nearest to the user input in > > the TextBox. > > > > How this can be implemented in PostgreSQL? > > You can search for the row with the closest above and the row with the > closest below and then return whichever these is closer. (Remember to handle > the case where the target is larger or smaller than all values in the > database.) You can use ORDER BY and LIMIT 1 and an appropiiate WHERE > clause (something like columnname >= targetvalue) to do this. > > Thank you for your great idea. But how it can be used for positioning the cursor in the already existed ResultSet? Using your idea I can found the closest to targetvalue row but not its position in my ResultSet. Anyway thank you for your idea it is very useful by itself. Also I can solve my problem using your idea and emulating the movement in my existed ResultSet. Even better - no need to store the large RS between cursor movements. Just each time I need to fetch the all visible rows. ---(end of broadcast)--- TIP 6: explain analyze is your friend
Re: [SQL] i have table
On 10/3/06 6:47 AM, "Penchalaiah P." <[EMAIL PROTECTED]> wrote: > > Hi ... > > I have one table with 12 fields.. > > > now I want to add one more field in this table.. but that field has to > come next to cda_no.. I mean as a 3rd field.. If I am adding that field > it is coming last field ... > The columns in a relation (table) are not ordered, so this question makes no sense. Why do you feel it necessary to have that field "next to" the other? > > may I know how it is possible to that table... > > Thanks & Regards > > Penchal reddy | Software Engineer > -- Daryl http://itsallsemantics.com "I¹m afraid of the easy stuff its always harder than it seems" -- Bill Hampton, 2006 ---(end of broadcast)--- TIP 6: explain analyze is your friend
Re: [SQL] Assigning a timestamp without timezone to a timestamp with timezone
On Mon, Oct 02, 2006 at 08:15:56PM -0700, chrisj wrote: > Two tables both the have open and close columns that are timestamp or > timestamp with time zone. I think the best answer is to convert the one table to timestamptz, and always enter explicitly the time zone with it (since you're going to know the corporate timezone anyway, right?). This way, you don't have to worry about the client's timezone setting, and you always get the right answer. For instance: test=# SHOW TimeZone ; TimeZone -- EST5EDT (1 row) test=# SELECT '2006-10-03 09:00:00-00'::timestamptz; timestamptz 2006-10-03 05:00:00-04 (1 row) This has the other advantage that if an office moves, its "open time" in history doesn't need to change, and you don't need external knowledge about what the office time zone is, because that's encoded in the timestamp. In general, I think timestamps without timezones are just a bad idea. A -- Andrew Sullivan | [EMAIL PROTECTED] I remember when computers were frustrating because they *did* exactly what you told them to. That actually seems sort of quaint now. --J.D. Baldwin ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org
Re: [SQL] Assigning a timestamp without timezone to a timestamp
Hi Andrew, I do appreciate your reply and we agree on two things timestamp without timezone should be avoided and the timestamps in table 2 should definately be "with timezone". I have no problem changing the timestamps in table 1 to "with timezone", but I do not see how this solves my problem (maybe I am just thick). the timestamps in table 1 are not the open and close times for the corporate location, but they are the directive to all store locations saying: "In the context of the timezone your store is located in, these are the hours you should be open. For example the corporate office may be on the east coast and they are saying that on December 24,2006 you should open at 9am and close at 1pm. Stores in California should open at 9:00am Pacific time and stores in New York should open at 9am EDT. If I did not appreciate the full implication of your answer please be patient with me sometimes I am slow but I usually get there. Andrew Sullivan wrote: > > On Mon, Oct 02, 2006 at 08:15:56PM -0700, chrisj wrote: >> Two tables both the have open and close columns that are timestamp or >> timestamp with time zone. > > I think the best answer is to convert the one table to timestamptz, > and always enter explicitly the time zone with it (since you're going > to know the corporate timezone anyway, right?). This way, you don't > have to worry about the client's timezone setting, and you always get > the right answer. For instance: > > test=# SHOW TimeZone ; > TimeZone > -- > EST5EDT > (1 row) > > test=# SELECT '2006-10-03 09:00:00-00'::timestamptz; > timestamptz > > 2006-10-03 05:00:00-04 > (1 row) > > This has the other advantage that if an office moves, its "open time" > in history doesn't need to change, and you don't need external > knowledge about what the office time zone is, because that's encoded > in the timestamp. > > In general, I think timestamps without timezones are just a bad > idea. > > A > > -- > Andrew Sullivan | [EMAIL PROTECTED] > I remember when computers were frustrating because they *did* exactly what > you told them to. That actually seems sort of quaint now. > --J.D. Baldwin > > ---(end of broadcast)--- > TIP 4: Have you searched our list archives? > >http://archives.postgresql.org > > -- View this message in context: http://www.nabble.com/Assigning-a-timestamp-without-timezone-to-a-timestamp-with-timezone-tf2373845.html#a6621346 Sent from the PostgreSQL - sql mailing list archive at Nabble.com. ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings
Re: [SQL] SEQUENCES
On Mon, Oct 02, 2006 at 13:39:38 -0300, Rodrigo Sakai <[EMAIL PROTECTED]> wrote: > Hi all, > > > > I need to get all sequences and their respective current values! Is there > any catalog table or any other away to get this??? You can get their names from pg_class (with relkind = 'S') and then iterate over the names and look at the table underlying each table (at last_value). ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster
Re: [SQL] Assigning a timestamp without timezone to a timestamp
On Tue, Oct 03, 2006 at 07:26:52AM -0700, chrisj wrote: > location, but they are the directive to all store locations saying: "In the > context of the timezone your store is located in, these are the hours you > should be open. Ah. Well, then, right, it _does_ have to be timezone free. That's actually the only case I'd use that. Sorry, I'm dim, and didn't understand properly what you were doing. (I read the "relative to the store's own time zone" to refer to the corporate office. No, I don't know why, either. Told you I'm dim.) Anyway, here's something that worked for me (expanding this into your case ought not to be too tricky): testing=# SELECT * from storetz ; id | timezone +-- 1 | -03 (1 row) testing=# SELECT a.timestamp::timestamptz from (SELECT '2006-10-03 09:00'||"timezone" as timestamp from storetz where id = 1) as a; timestamp 2006-10-03 12:00:00+00 (1 row) A -- Andrew Sullivan | [EMAIL PROTECTED] When my information changes, I alter my conclusions. What do you do sir? --attr. John Maynard Keynes ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings
[SQL] Update 3 columns w/ 1 function calc 3 values?
Hi all, I am moving some of my old MS Access functions to plpgsql. My function was made to return coordinates, X,Y,Z for a point along a curved line. So it is not the fastest of functions because it has to call and query data from 3 different tables. I used to just create 3 wrapper functions for my main function which would return the x, y, and z values seperately but that requires the main function to be called 3 seperate times. So here is my bottle neck. Of course I need to update +50,000 records. What should I do to speed this up. What is the best way to update 3 columns from one function call. In MSACCESS I once rig the function to cycle through the records with a curser but that was slow and would crap out due to the shear number. Thanks, Phil ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
Re: [SQL] Update 3 columns w/ 1 function calc 3 values?
2006/10/3, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: Hi all,I am moving some of my old MS Access functions toplpgsql.My function was made to return coordinates, X,Y,Zfor a point along a curved line. So it is not thefastest of functions because it has to call and query data from 3 different tables. I used tojust create 3 wrapper functions for my mainfunction which would return the x, y, and z valuesseperately but that requires the main function tobe called 3 seperate times. So here is my bottle neck. Of course I need to update +50,000 records.What should I do to speed this up. What is thebest way to update 3 columns from one functioncall. It's realy very hard say something without the involving tables schema. You can: - change the function to return x,y,z in one call only ? - join the tables? - what is the function language? In MSACCESS I once rig the function tocycle through the records with a curser but thatwas slow and would crap out due to the shear number.Thanks,Phil-- William Leite Araújo
Re: [SQL] Assigning a timestamp without timezone to a timestamp
Brilliant, elegant and simple !! I can't wait to try it (don't have access to Postgres 9-5 EDT) !! thank-you !! Andrew Sullivan wrote: > > On Tue, Oct 03, 2006 at 07:26:52AM -0700, chrisj wrote: >> location, but they are the directive to all store locations saying: "In >> the >> context of the timezone your store is located in, these are the hours >> you >> should be open. > > Ah. Well, then, right, it _does_ have to be timezone free. That's > actually the only case I'd use that. Sorry, I'm dim, and didn't > understand properly what you were doing. (I read the "relative to > the store's own time zone" to refer to the corporate office. No, I > don't know why, either. Told you I'm dim.) > > Anyway, here's something that worked for me (expanding this into your > case ought not to be too tricky): > > testing=# SELECT * from storetz ; > id | timezone > +-- > 1 | -03 > (1 row) > > testing=# SELECT a.timestamp::timestamptz from (SELECT '2006-10-03 > 09:00'||"timezone" as timestamp from storetz where id = 1) as a; >timestamp > > 2006-10-03 12:00:00+00 > (1 row) > > A > -- > Andrew Sullivan | [EMAIL PROTECTED] > When my information changes, I alter my conclusions. What do you do sir? > --attr. John Maynard Keynes > > ---(end of broadcast)--- > TIP 5: don't forget to increase your free space map settings > > -- View this message in context: http://www.nabble.com/Assigning-a-timestamp-without-timezone-to-a-timestamp-with-timezone-tf2373845.html#a6622976 Sent from the PostgreSQL - sql mailing list archive at Nabble.com. ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org
Re: [SQL] How to FindNearest
On Tue, Oct 03, 2006 at 14:43:40 +0300, Alexander Ilyin <[EMAIL PROTECTED]> wrote: > > Thank you for your great idea. But how it can be used for positioning the > cursor in the already existed ResultSet? Using your idea I can found the > closest to targetvalue row but not its position in my ResultSet. You wouldn't be able to use it to position a cursor. But if you aren't retrieving a lot of records at once, this may still be a workable strategy for you. > Anyway thank you for your idea it is very useful by itself. Also I can solve > my problem using your idea and emulating the movement in my existed > ResultSet. Even better - no need to store the large RS between cursor > movements. Just each time I need to fetch the all visible rows. That sounds pretty reasonable. ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org
Re: [SQL] Update 3 columns w/ 1 function calc 3 values?
On Tue, Oct 03, 2006 at 14:55:55 +, [EMAIL PROTECTED] wrote: > My function was made to return coordinates, X,Y,Z > for a point along a curved line. So it is not the > fastest of functions because it has to call and > query data from 3 different tables. I used to > > What should I do to speed this up. What is the > best way to update 3 columns from one function > call. In MSACCESS I once rig the function to > cycle through the records with a curser but that > was slow and would crap out due to the shear number. Why is the data in three different tables? It is unusual to not have all coordinates in the same table using one column per coordinate. If you need to update 3 tables, you will need 3 update statements. Doing all of the updates in a single transaction will help. If possible doing all of the updates for each coordinate table in one command will help. To do that you would need the data to be coming from data already in the database. Chnaging the design of your database so that the coordinates are all in the same table (assuming that is possible) would be a good idea. ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
[SQL] Updating from table with multiple possibilities
I have two tables, ips and ranges, where ips contains a list of ips (INET) and ranges contains a list of ip blocks (CIDR), ala: CREATE TABLE ips (ip INET, info varchar); CREATE TABLE ranges (range CIDR, info varchar); I would like to update the info column in ips to be the info column of the most specific block in ranges. For example, if ranges had the following data: 0.0.0.0/0, 'top level class' 18.0.0.0/8, 'MIT' 18.228.0.0/20, 'MIT Group B' and ips only had the row "'18.228.0.1', NULL" then doing an update would change the column in ips to "'18.228.0.1', 'MIT Group B'" I can't quite figure out the update syntax to get this to work. This obviously does not work (as mentioned in the manual), as there are multiple results returned from the 'join' and I only want the 'best' match: UPDATE ips SET info = ranges.info FROM ranges WHERE ip <<= range I figure that I have to use subselects, but I can't seem to figure out how to get the data out of the subselect (i.e. the info column). Do I need to join ips and ranges explicitly? Thanks! ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster
Fw: [SQL] How to FindNearest
I guess I explained that very poorly. Sorry. It is actually much simplier. I have 3 tables Hole Hole_id X Y Z Down_hole_survey Hole_id Depth_meters Azimuth Vertical_inclination X Y Z Sample Hole_id Depth_meters X Y Z Hole_id is a primary key in the hole table while it is a foriegn key in down_hole_survey and sample tables. My function will take all the above info about the hole and down_hole_survey tables, and sample.hole_id and sample.depth_meters and will calculate the coordinates. I need to put these coordinates into sample.x , sample.y and sample.z . What I used to do was have one function that would return 3 values (x,y,z). Then create 3 more functions that would call call the main function and pull out the 3 values seperately to update the 3 seperate columns. It works fine but I have to call the main function 3 times which produces a slow performance. I hope that I explained it better this time. Phil Sent via BlackBerry from Cingular Wireless -Original Message- From: Bruno Wolff III <[EMAIL PROTECTED]> Date: Tue, 3 Oct 2006 12:11:25 To:Alexander Ilyin <[EMAIL PROTECTED]> Cc:[email protected] Subject: Re: [SQL] How to FindNearest On Tue, Oct 03, 2006 at 14:43:40 +0300, Alexander Ilyin <[EMAIL PROTECTED]> wrote: > > Thank you for your great idea. But how it can be used for positioning the > cursor in the already existed ResultSet? Using your idea I can found the > closest to targetvalue row but not its position in my ResultSet. You wouldn't be able to use it to position a cursor. But if you aren't retrieving a lot of records at once, this may still be a workable strategy for you. > Anyway thank you for your idea it is very useful by itself. Also I can solve > my problem using your idea and emulating the movement in my existed > ResultSet. Even better - no need to store the large RS between cursor > movements. Just each time I need to fetch the all visible rows. That sounds pretty reasonable. ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org
[SQL] timestamps over the web - suggestions
My server is based MST, but web clients from Maine to Hawaii, and they wish to see timestamps based in their own locale.Can anyone tell me how they're handling this? (sorry - can't get rid of my clients) Do you Yahoo!? Get on board. You're invited to try the new Yahoo! Mail.
[SQL] formatting intervals with to_char
Hi,
I'm trying to format the output of a time interval so that it displays
as HH:MM:SS no matter how many days it spans. So for instance, an
interval of 2 days 4 hours and 0 minutes would look something like
"52:00:00". The documentation for to_char states that:
"|to_char(interval)| formats HH and HH12 as hours in a single day, while
HH24 can output hours exceeding a single day, e.g. >24."
However I can not get it to work with time intervals that span more than
1 day. For instance, the following query returns this time interval:
Query:
select ('2006-09-15T23:59:00'::timestamp - '2006-09-01
09:30:41'::timestamp);
Result:
14 days 14:28:19
But when I run to_char on this with HH24, it doesn't take into effect
the number of days:
Query:
select to_char(('2006-09-15T23:59:00'::timestamp - '2006-09-01
09:30:41'::timestamp), 'HH24:MI:SS');
Result:
14:28:19
It just gives me the offset of hours, min, seconds on that 14th day.
The result I'm looking for is: 350:28:19
What am I doing wrong, or how can I get this desired output? Thanks,
--
Graham Davis
Refractions Research Inc.
[EMAIL PROTECTED]
---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster
Re: [SQL] timestamps over the web - suggestions
You should probably handle this at the application level. How you go about it will depend on what programming language you use.If you don't like that, check out the timezone function: http://www.postgresql.org/docs/8.0/static/runtime-config.html#GUC-TIMEZONESee also for an example:http://www.varlena.com/GeneralBits/3.phpon how to use SET: set time zone 'PST8PDT'; select now();Now if I could just find a list of time zones to use...On 10/3/06, chester c young < [EMAIL PROTECTED]> wrote:My server is based MST, but web clients from Maine to Hawaii, and they wish to see timestamps based in their own locale. Can anyone tell me how they're handling this? (sorry - can't get rid of my clients) == Aaron Bono Aranya Software Technologies, Inc. http://www.aranya.com http://codeelixir.com==
Re: [SQL] timestamps over the web - suggestions
[EMAIL PROTECTED] wrote: > > My server is based MST, but web clients from Maine to Hawaii, and they wish > to see timestamps based in their own locale. > > Can anyone tell me how they're handling this? (sorry - can't get rid of my > clients) Here's a bit of JavaScript that might work for you. It sets a cookie to the user's timezone offset (vs GMT, in minutes). You put something like this on an initial page (portal, login page, whatever), and then subsequent pages will be requested along with the timezone cookie. If you are using PHP, for example, your scripts just access $_COOKIE['timezone'] and adjust things accordingly for the user's timezone. ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
Re: [SQL] Fw: How to FindNearest
On Tue, Oct 03, 2006 at 17:35:55 +, [EMAIL PROTECTED] wrote: > > My function will take all the above info about the hole and down_hole_survey > tables, and sample.hole_id and sample.depth_meters and will calculate the > coordinates. I need to put these coordinates into sample.x , sample.y and > sample.z . > > What I used to do was have one function that would return 3 values (x,y,z). > Then create 3 more functions that would call call the main function and pull > out the 3 values seperately to update the 3 seperate columns. It works fine > but I have to call the main function 3 times which produces a slow > performance. > > I hope that I explained it better this time. If they are in the same table you can update all there in the same update statement using syntax something like the following: UPDATE sample SET x=(some expression), y=(some expression), z=(some expression) WHERE some condition; Probably the simplest place to start is having your function do the update rather than return the three values. I think in 8.2 there will be an easier way to use the result of a function that returns a row to update multiple columns in an update statement. (That doesn't resu;t in calling the function three times.) ---(end of broadcast)--- TIP 6: explain analyze is your friend
