Re: [SQL] FUNCTION problem

2009-04-01 Thread Adrian Klaver
On Wednesday 01 April 2009 4:31:20 pm Peter Willis wrote: > Hello, > > I am having a problem with a FUNCTION. > The function creates just fine with no errors. > > However, when I call the function postgres produces an error. > > Perhaps someone can enlighten me. > > > --I can reproduce the error by

[SQL] FUNCTION problem

2009-04-01 Thread Peter Willis
Hello, I am having a problem with a FUNCTION. The function creates just fine with no errors. However, when I call the function postgres produces an error. Perhaps someone can enlighten me. --I can reproduce the error by making a test function --that is much easier to follow that the original:

Re: [SQL] Stored function not accepting null value?

2009-04-01 Thread Deirdre Hall
And that would be where I went wrong. Thanks. DHall -Original Message- From: Tom Lane [mailto:t...@sss.pgh.pa.us] Sent: Wednesday, April 01, 2009 2:01 PM To: Deirdre Hall Cc: pgsql-sql@postgresql.org Subject: Re: [SQL] Stored function not accepting null value? "Deirdre Hall" writes:

Re: [SQL] Stored function not accepting null value?

2009-04-01 Thread Tom Lane
"Deirdre Hall" writes: > I am using a stored function to determine whether a table needs an update > or insert, based on the merge_db function in the postgres documentation. > (Not currently including it below because it's rather long, but other than > the fact that it contains 27 values, it's pre

[SQL] Stored function not accepting null value?

2009-04-01 Thread Deirdre Hall
I am using a stored function to determine whether a table needs an update or insert, based on the merge_db function in the postgres documentation. (Not currently including it below because it's rather long, but other than the fact that it contains 27 values, it's pretty much the same as that exampl

Re: [SQL] Add: Special sort querstion

2009-04-01 Thread Scott Marlowe
On Fri, Mar 27, 2009 at 6:10 AM, Dominik Piekarski wrote: > Oh, actually every row of the same id-range has the same start_lat/start_lng > coordinates as the predecessors end_lat/end_lng coordinates. But the > question remains the same. Is there a way to do something like ORDER BY > (start_lat = e

Re: [SQL] Add: Special sort querstion

2009-04-01 Thread Dirk Jagdmann
I think it can not be done with default PostgreSQL functions and operators, because you must compare two different columns of two rows depending which row is on either side of the "<" comparision. But I think you can do this with the following steps: 1) create a new type as a 4-tupel of start_lat

Re: [SQL] Add: Special sort querstion

2009-04-01 Thread Dirk Jagdmann
I think it can not be done with default PostgreSQL functions and operators, because you must compare two different columns of two rows depending which row is on either side of the "<" comparision. But I think you can do this with the following steps: 1) create a new type as a 4-tupel of start_lat