Re: [SQL] Identifying which column matches a full text search

2008-07-29 Thread Richard Huxton
Ryan Wallace wrote: UPDATE pgweb SET textsearchable_index_col = to_tsvector('english', coalesce(title,'') || coalesce(body,'')); WHERE textsearchable_index_col @@ to_tsquery('create & table') Using this approach. Is there any way of retrieving which of the original two columns the mat

Re: [SQL] column names with - and (

2008-07-29 Thread Igor Neyman
Maria, Try "" (double quotes: select x1 as "IL-a", x2 as "IL-a(p30)" from abc should help. Igor From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of maria s Sent: Tuesday, July 29, 2008 12:07 PM To: Osvaldo Rosario Kussama; pgsql-sql@postgresq

[SQL] Identifying which column matches a full text search

2008-07-29 Thread Ryan Wallace
Hi all, The following example is given in the Postgres 8.3 manual regarding how to create a single ts_vector column for two existing columns: ALTER TABLE pgweb ADD COLUMN textsearchable_index_col tsvector; UPDATE pgweb SET textsearchable_index_col = to_tsvector('english', coalesce(ti

Re: [SQL] column names with - and (

2008-07-29 Thread maria s
Its okay, Yes I am using quotes. Michael was telling that too. Thanks for all the help at all times. Maria On Tue, Jul 29, 2008 at 12:37 PM, Oliveiros Cristina < [EMAIL PROTECTED]> wrote: > You can enclose the names in quotes, then the characters are allowed > > Sorry to mislead you :p > > Be

Re: [SQL] column names with - and (

2008-07-29 Thread Oliveiros Cristina
You can enclose the names in quotes, then the characters are allowed Sorry to mislead you :p Best, Oliveiros - Original Message - From: Oliveiros Cristina To: maria s ; Osvaldo Rosario Kussama ; pgsql-sql@postgresql.org ; Pavel Stehule ; Ivan Sergio Borgonovo Sent: Tuesday,

Re: [SQL] column names with - and (

2008-07-29 Thread maria s
Hi Oliveiros, Thanks for the link. Yes I read it. But I am using "" for the column names. So now I am getting the result that I need. Thanks for all your help. Maria On Tue, Jul 29, 2008 at 12:27 PM, Oliveiros Cristina < [EMAIL PROTECTED]> wrote: > Maria, > > The minus, open bracket and close

Re: [SQL] column names with - and (

2008-07-29 Thread Oliveiros Cristina
Maria, The minus, open bracket and close bracket are illegal as identifier names http://www.postgresql.org/docs/8.3/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS Best, Oliveiros - Original Message - From: maria s To: Osvaldo Rosario Kussama ; pgsql-sql@postgresql.org ;

[SQL] column names with - and (

2008-07-29 Thread maria s
Hi All, When I am fetching the data from a table, I am giving the column names with - and ( and ) like IL-a, IL-a(p30) etc.. select x1 as IL-a, x2 as IL-a(p30) from abc But I am getting ERROR: syntax error at or near "-" and also t "(" , ")" Can anyone help me to fix this? Thank you, Maria

Re: [SQL] Query prepared plan

2008-07-29 Thread Emi Lu
Similar to \dt to show all tables, within one session, may I know the command to list all prepared query plan please? select * from pg_prepared_statements; Thank you! I think this is the command. Too bad that I could not use it under 8.0x. select * from pg_prepared_statements; ERROR: rela