Re: [SQL] Function returning setof taking parameters from another table

2008-08-01 Thread Craig Ringer
Marcin Stępnicki wrote: So far the only method I can think of is to use union all with different parametrs, like: select * from f_test(123) union all select * from f_test(124) union all select * from f_test(125); But it is not flexible, I'd like to have parameters stored in another

[SQL] How to change a view's owner in postgres

2008-08-01 Thread Anoop G
Dear All, How to change a view's owner in postgres? thanks in advance: Anoop

Re: [SQL] How to change a view's owner in postgres

2008-08-01 Thread Marcin Stępnicki
On Fri, Aug 1, 2008 at 11:41 AM, Anoop G [EMAIL PROTECTED] wrote: How to change a view's owner in postgres? ALTER TABLE view_name OWNER TO new_owner; -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

[SQL] regexp_replace

2008-08-01 Thread Marcin Krawczyk
Hi all. I'd like to know whether it's possible to reverse the behaviour of regexp_replace, meaning : now if I do SELECT regexp_replace ('foobarbaz', 'b..', 'X') I get 'fooXbaz' - it replaces the string that matches given pattern with 'X', how do I achieve the opposite - replace the string that

Re: [SQL] regexp_replace

2008-08-01 Thread Pawel Socha
2008/8/1 Marcin Krawczyk [EMAIL PROTECTED] Hi all. I'd like to know whether it's possible to reverse the behaviour of regexp_replace, meaning : now if I do SELECT regexp_replace ('foobarbaz', 'b..', 'X') I get 'fooXbaz' - it replaces the string that matches given pattern with 'X', how do I

Re: [SQL] regexp_replace

2008-08-01 Thread Marcin Krawczyk
thanks / dzieki regards / pozdrowienia mk 2008/8/1 Pawel Socha [EMAIL PROTECTED]: 2008/8/1 Marcin Krawczyk [EMAIL PROTECTED] Hi all. I'd like to know whether it's possible to reverse the behaviour of regexp_replace, meaning : now if I do SELECT regexp_replace ('foobarbaz', 'b..', 'X') I

[SQL] Savepoints and SELECT FOR UPDATE in 8.2

2008-08-01 Thread EXT-Rothermel, Peter M
I have a client application that needs: SELECT a set of records from a table and lock them for potential updates. for each record make some updates to this record and some other records in other tables call some call a function that does some application logic that does not access the

Re: [SQL] column names with - and (

2008-08-01 Thread maria s
Hi Igor, Thanks for the info. I am using double quotes now and getting the result that I needed. Thank you, Maria On Tue, Jul 29, 2008 at 3:14 PM, Igor Neyman [EMAIL PROTECTED] wrote: Maria, Try (double quotes: select x1 as IL-a, x2 as IL-a(p30) from abc should help. Igor

Re: [SQL] Savepoints and SELECT FOR UPDATE in 8.2

2008-08-01 Thread Scott Marlowe
On Fri, Aug 1, 2008 at 11:02 AM, EXT-Rothermel, Peter M [EMAIL PROTECTED] wrote: I was thinking of something like this: connect to DB BEGIN SELECT * FROM table_foo where foo_state = 'queued' FOR UPDATE; for each row do [ SAVEPOINT s; UPDATE foo_resource SET in_use = 1 WHERE