Re: [SQL] Getting the output of a function used in a where clause

2005-04-11 Thread PFC
try: SELECT zipcode, zipdist($lat1d,$lon1d,lat,long) as distance from zipcodes where distance = $dist;; OR you could use a gist index with a geometric datatype to get it a lot faster. On Sat, 09 Apr 2005 03:43:39 +0200, Bill Lawrence [EMAIL PROTECTED] wrote: HI, Im a newbie so please bear

Re: [SQL] Problems with Set Returning Functions (SRFs)

2005-04-11 Thread Sean Davis
On Apr 6, 2005, at 2:53 PM, Otto Blomqvist wrote: secom=# select f1, f2, f3 from testpassbyval(1, (Select number1 from test)); ERROR: more than one row returned by a subquery used as an expression This is where I fail. Am I even on the right path here ? Writing the actual parsing function will

[SQL] How to Port Oracle's user defined Package into Postgres 8.0.1.

2005-04-11 Thread Dinesh Pandey
Title: How to Port Oracle's user defined Package into Postgres 8.0.1. Hi folks, Can any one give me an idea about: How to Port Oracle's user defined Package into Postgres 8.0.1. If possible pls attache sample code. Thanks Dinesh Pandey

[SQL] Update aborted if trigger function fails?

2005-04-11 Thread Carlos Moreno
Hi, I just noticed this (odd?) behaviour, and it kind of scares me. For testing purposes, I put a deliberate syntax error; this wouldn't happen in a real-life situation. But what if the error gets triggered by something that happens later on? say, if the trigger function uses a field that later

[SQL] PGCrypto: Realworld scenario and advice needed

2005-04-11 Thread Moran.Michael
Hello all, I'm looking for advice on real-world PGCrypto usage. I understand how to programmatically encrypt/decrypt data with PGCrypto -- no problem. My question is: What is the best way to update massive amounts of *existing* encrypted data with a new encryption passphrase, assuming you

Re: [SQL] PGCrypto: Realworld scenario and advice needed

2005-04-11 Thread Joe Conway
Moran.Michael wrote: My initial attack plan was to do the following: 1. Call decrypt() with the old-passphrase to decrypt each table's existing data. 2. Temporarily store the decrypted data in temp tables. 3. Delete all rows of encrypted data from the original tables -- thereby clearing the

[SQL] Query runs very slowly in Postgres, but very fast in other DBMS

2005-04-11 Thread Andrus Moor
Tables: CREATE TABLE dok ( dokumnr NUMERIC(12), CONSTRAINT dok_pkey PRIMARY KEY (dokumnr) ); CREATE TABLE rid ( dokumnr NUMERIC(12) ); CREATE INDEX rid_dokumnr_idx ON rid (dokumnr); Query: SELECT dokumnr FROM rid WHERE dokumnr NOT IN (select dokumnr FROM dok); runs VERY slowly in

[SQL] OpenFTS

2005-04-11 Thread Dan Feiveson
Hoping someone can provide feedback on integrating OpenFTS into Postgres. I am running pg 7.3.4 and have a large database of articles that are constantly changing ( being added, updated, removed). I want to perform key word searches across these articles, ranked by relevance and have

Re: [SQL] Query runs very slowly in Postgres, but very fast in other DBMS

2005-04-11 Thread Tom Lane
Andrus Moor [EMAIL PROTECTED] writes: Seq Scan on rid (cost=0.00..28698461.07 rows=32201 width=14) Filter: (NOT (subplan)) SubPlan - Seq Scan on dok (cost=0.00..864.29 rows=10729 width=14) Is it possible to speed up this query is Postgres ? Can you switch to int4 or int8 instead