Re: [SQL] How to write query to access another odbc source

2011-10-19 Thread pasman pasmański
Hi. If you have 9.1, then exist foreign wrapper odbc_fdw, you may try it. 2011/10/19, Rich : >> >> I have a mumps database with an ODBC connection so I can write queries >> from >> this database. How can I write a sql in Postgresql to access this >> database >> to use in my Postgresql reports? >

Re: [SQL] Better way to check more than 1 value NOT IN (...)

2011-09-24 Thread pasman pasmański
You can write condition in subquery: where 0=(select count(*) from myfunction(id) where x in (10,20)) 2011/9/24, Andreas : > Hi, > I've got to check if 2 values are not in a set that is dynamically > calculated by a function. > > The query looks like > > select some_id, > from . > whe

Re: [SQL] Clever way to check overlapping time intervals ?

2011-09-16 Thread pasman pasmański
You can convert dates to cube, they have overlap operator && 2011/9/16, Andreas Kretschmer : > Andreas wrote: > >> Hi, >> is there a clever way to check overlapping time intervals ? >> An option named n should be taken from date y to y. >> The same name is ok for another interval. >> >> e.g.

Re: [SQL] Use select and update together

2011-09-12 Thread pasman pasmański
In 8.4 this syntax is not implemented. 2011/9/12, Boris : > Hi, this is my first on this list. > > I can't understand where my problem in PG 8.4. > > CREATE TABLE tbl( KEY int, val int); > > Update query like: > > UPDATE tbl SET val = 1 > WHERE KEY = any('{0,1,2,3,4,5}'::int[]) >

Re: [SQL] My Trigger is not working :(

2011-09-09 Thread pasman pasmański
DECLARE section not contain variable AD_TABLE_ID 2011/9/9, Waqar Azeem : > I think i missed some basics ... > > > ERROR: column "ad_table_id" does not exist > Where: PL/pgSQL function "oms_changelog" line 21 at assignment > > -- > trigger definition >

Re: [SQL] LTREE extension and "order by"

2011-07-20 Thread pasman pasmański
Hi. You should convert path to integer[]. 2011/7/20, Ivan Polak : > Hi, > > in postgreSQL (with LTREE extension) database I have the following > table "comments": > > id BIGINT /* id */ > article_id BIGINT /*article-id */ > parent_id BIGINT > comment TEXT > path LTREE > level INTEGER /* level */

Re: [SQL] After insert trigger and select

2011-02-16 Thread pasman pasmański
> If I have after insert trigger on some table which updates some data in > that same table, will be the select statement from some other client > executed after all statements in that trigger? > select statement is fired before commit ? pasman -- Sent via pgsql-sql mailing list (pg

Re: [SQL] pattern matching with dates?

2011-01-07 Thread pasman pasmański
Sorry, but this examples not use index. On 1/7/11, Susanne Ebrecht wrote: > Hello Thomas, > > On 05.01.2011 20:39, Good, Thomas wrote: >> select * from db_log where log_date LIKE '2011-01-%'; > > The lazy way would be something like this: > SELECT * from tab WHERE log_date::VARCHAR LIKE '2011-01-