Re: [SQL] ERROR: missing FROM-clause entry for table "new"

2012-09-13 Thread David Johnston
On Sep 13, 2012, at 20:40, James Sharrett wrote: > I'm trying to define a trigger function that looks for changes in table A > (table the trigger for the function is on) and write a delta record into > table B. So if a record has a value of 100 in table A, and it is updated to > 50, the funct

[SQL] ERROR: missing FROM-clause entry for table "new"

2012-09-13 Thread James Sharrett
I'm trying to define a trigger function that looks for changes in table A (table the trigger for the function is on) and write a delta record into table B. So if a record has a value of 100 in table A, and it is updated to 50, the function should write ­50 in table B. I can get the trigger to work

Re: [SQL] generate_series() with TSTZRANGE

2012-09-13 Thread Wolfe Whalen
That's much better, thank you! -- Wolfe Whalen wo...@quios.net On Thu, Sep 13, 2012, at 06:52 AM, Sergey Konoplev wrote: > On Thu, Sep 13, 2012 at 3:53 AM, Wolfe Whalen > wrote: > > SELECT tstzrange((lag(a) OVER()), a, '[)') > > FROM generate_series('2012-09-16 12:00:00'::timestamp, '2012-

Re: [SQL] underscore pattern in a query doens't work

2012-09-13 Thread Tom Lane
"Sergio C." writes: > We started the cluster up with this command: > ./initdb -D /usr/local/postgre/data -E UTF8 -U sir That doesn't prove anything about the specific database where you're having the problem ... regards, tom lane -- Sent via pgsql-sql mailing list (pgs

Re: [SQL] underscore pattern in a query doens't work

2012-09-13 Thread Sergio C.
Thanks Tom, for your suggestions. We started the cluster up with this command: ./initdb -D /usr/local/postgre/data -E UTF8 -U sir The rest of the variables related to encoding (locale) are: lc_collate=C lc_ctype=C lc_messages=C lc_monetary=C lc_numeric=C lc_time=C Could you tell me which more in

Re: [SQL] underscore pattern in a query doens't work

2012-09-13 Thread Tom Lane
"Sergio Calero." writes: > I'd like to execute a query using the underscore as a pattern. > select id,etiqueta from limites_municipales where etiqueta like 'Garaf_a'; > [ but this fails to match 'Garafía' ] I suspect what you have here is an encoding problem. That is, probably the "í" is represe

Re: [SQL] generate_series() with TSTZRANGE

2012-09-13 Thread Sergey Konoplev
On Thu, Sep 13, 2012 at 3:53 AM, Wolfe Whalen wrote: > SELECT tstzrange((lag(a) OVER()), a, '[)') > FROM generate_series('2012-09-16 12:00:00'::timestamp, '2012-09-17 > 12:00:00', '1 hour') > AS a OFFSET 1; What about this form? select tstzrange(a, a + '1 hour'::interval, '[)') from generate_ser

Re: [SQL] pg_restore problem

2012-09-13 Thread Adrian Klaver
On 09/12/2012 12:23 AM, Kjell Øygard wrote: Morning guys... I have two servers , one with postgres 9.2rc1 and one with postgres 9.1.4. I need to do a restore from a dump from 9.1.4 to 9.2rc1 and I get this error: pg_restore: [archiver (db)] Error from TOC entry 177675; 2613 579519 BLOB 579519 p

[SQL] underscore pattern in a query doens't work

2012-09-13 Thread Sergio Calero.
Hello everyone! Below you can find the problem I'm dealing with. I'd appreciate your help. Thank you!! - A description of what you are trying to achieve and what results you expect.: I'd like to execute a query using the underscore as a pattern. select id,etiqueta from limites_municipales where