Re: [SQL] EXECUTE query INTO problem

2008-11-25 Thread Pawel Socha
2008/11/25 Tk421 <[EMAIL PROTECTED]>: > I've got a problem with a function: It receives two parameters, the first, > the table name, and the second, a where condition. The function looks like > this: > > DECLARE > cod bigint; > query TEXT; > > BEGIN > query = 'SELECT codigo FRO

Re: [SQL] EXECUTE query INTO problem

2008-11-25 Thread Andreas Kretschmer
Tk421 <[EMAIL PROTECTED]> schrieb: >I've got a problem with a function: It receives two parameters, the > first, the table name, and the second, a where condition. The function > looks like this: > >DECLARE > cod bigint; > query TEXT; > >BEGIN > query = 'SELECT co

[SQL] EXECUTE query INTO problem

2008-11-25 Thread Tk421
I've got a problem with a function: It receives two parameters, the first, the table name, and the second, a where condition. The function looks like this: DECLARE cod bigint; query TEXT; BEGIN query = 'SELECT codigo FROM ' || $1 || ' WHERE ' || $2; EXECUTE qu

Re: [SQL] Full text search ordering question

2008-11-25 Thread John Lister
Thanks for the reply and apologies, it was my first post. I'm running on PG 8.3.3 (ubuntu), i haven't tried gin as that doesn't support multi-column. I haven't used 8.4 as it is still in development? a sample query is as follows select node_id from breadcrumbs where textsearchable @@ to_tsque

Re: [SQL] Full text search ordering question

2008-11-25 Thread Oleg Bartunov
John, it's a good tradition to include query and their EXPLAIN ANALYZE. Pg version is also useful. Did you try GIN index ? In 8.4 you can use gin index on (views,tsvector) Oleg On Tue, 25 Nov 2008, John Lister wrote: Hi, is it possible to order the results of a full text search using another

Re: [SQL] Sequence and nextval problem

2008-11-25 Thread Steve Midgley
At 11:20 PM 11/24/2008, [EMAIL PROTECTED] wrote: Message-Id: <[EMAIL PROTECTED]> From: ries van Twisk <[EMAIL PROTECTED]> To: Tk421 <[EMAIL PROTECTED]> In-Reply-To: <[EMAIL PROTECTED]> Subject: Re: Sequence and nextval problem Date: Mon, 24 Nov 2008 16:21:40 -0500 References: <[EMAIL PROTECTED]>

[SQL] Full text search ordering question

2008-11-25 Thread John Lister
Hi, is it possible to order the results of a full text search using another field? for example with the following table: CREATE TABLE breadcrumbs ( node_id integer NOT NULL, breadcrumb character varying, textsearchable tsvector, views integer, CONSTRAINT pk_breadcrumbs PRIMARY KEY (node_id