Re: [SQL] Changing the transaction isolation level within the

2006-01-25 Thread Mario Splivalo
On Wed, 2006-01-25 at 15:54 +0100, Markus Schaber wrote: > Hi, Mario, > > Mario Splivalo wrote: > > Is it possible to change the transaction level within the procedure? > > No, currently not, the PostgreSQL "stored procedures" really are "stored > functions" that are called inside a query, and th

Re: [SQL] Changing the transaction isolation level within the

2006-01-25 Thread Mario Splivalo
On Wed, 2006-01-25 at 11:46 -0500, Jaime Casanova wrote: > you need to set the transaction level after the begin and before every > other statement... after the begin you have a select that invoke your > function so that set is not the first statement... But I can't do that inside of a function,

Re: [SQL] filtering after join

2006-01-25 Thread andrew
Sorry for the confusion. This is what i meant. Thanks, Michael. select * from (select * from A, B where A.a = B.b) as s where foo(s) < 2; On 1/25/06, Peter Eisentraut <[EMAIL PROTECTED]> wrote: > andrew wrote: > > I want to use a UDF to filter tuples t that are generated after a > > join. More sp

Re: [SQL] filtering after join

2006-01-25 Thread Peter Eisentraut
andrew wrote: > I want to use a UDF to filter tuples t that are generated after a > join. More specifially, I have a UDF foo(record), which computes a > value for a given tuple. I can do the filtering before the join. > e.g.: > > select * from A, B where foo(A)<2 and A.a=B.b; What makes you think

Re: [SQL] filtering after join

2006-01-25 Thread Michael Fuhr
On Wed, Jan 25, 2006 at 06:27:33PM +0100, andrew wrote: > I want to use a UDF to filter tuples t that are generated after a join. > More specifially, I have a UDF foo(record), which computes a value for > a given tuple. I can do the filtering before the join. e.g.: > > select * from A, B where fo

Re: [SQL] psql in the command line

2006-01-25 Thread Owen Jacobson
Alvaro Herrera wrote: > [EMAIL PROTECTED] wrote: > > > test:/opt/pgsql# echo "copy test from '/data/log/bla';" | psql logdb > > COPY > > > > But when I try to execute it as root user I get the following error: > > > > [est/data/log] su - postgres -c "echo 'copy test from > /data/log/bla;'| > >

[SQL] filtering after join

2006-01-25 Thread andrew
I want to use a UDF to filter tuples t that are generated after a join. More specifially, I have a UDF foo(record), which computes a value for a given tuple. I can do the filtering before the join. e.g.: select * from A, B where foo(A)<2 and A.a=B.b; But I want to apply foo() to the tuples gener

Re: [SQL] Changing the transaction isolation level within the stored procedure?

2006-01-25 Thread Jaime Casanova
> 1. java got the message via http (whatever) > 2. java does: begin; > 3. java does: select * from create_message(...) > 4. java does some checking > 5. java does: select * from set_message_status(...) > 6. java does some more checing > 7. java does commit; (under rare circumstances java does rollb

Re: [SQL] psql in the command line

2006-01-25 Thread Alvaro Herrera
[EMAIL PROTECTED] wrote: > test:/opt/pgsql# echo "copy test from '/data/log/bla';" | psql logdb > COPY > > But when I try to execute it as root user I get the following error: > > [est/data/log] su - postgres -c "echo 'copy test from /data/log/bla;'| > psql logdb" > ERROR: syntax error at or ne

[SQL] psql in the command line

2006-01-25 Thread Aniko.Badzong
Title: psql in the command line Hi I need some help regarding psql syntax. I would like to copy text files into the database from the command line in a script. I have found already how can I do it as user postrgres: test:/opt/pgsql# echo "copy test from '/data/log/bla';" | psql logdb C

Re: [SQL] Changing the transaction isolation level within the stored

2006-01-25 Thread Markus Schaber
Hi, Mario, Mario Splivalo wrote: > Is it possible to change the transaction level within the procedure? No, currently not, the PostgreSQL "stored procedures" really are "stored functions" that are called inside a query, and thus cannot contain inner transactions. > I'm using Postgres 8.1.2 defau

[SQL] Changing the transaction isolation level within the stored procedure?

2006-01-25 Thread Mario Splivalo
Is it possible to change the transaction level within the procedure? I'm using Postgres 8.1.2 default isolation level. But, I would like one stored procedure to execute as in serializable isolation level. I have created my stored procedure like this: CREATE OR REPLACE FUNCTION set_message_status(

Re: [SQL] hi all......................!!

2006-01-25 Thread Markus Schaber
Hi, Akilesh, AKHILESH GUPTA wrote: > i am new to this mailing list. this is my first mail to this group. > i jussst want to confirm that whether is it possible to update a view or > not?? > i think you all help me in solving my queries in future...!! Do you think about issuing UP

Re: [SQL] hi all......................!!

2006-01-25 Thread Richard Huxton
AKHILESH GUPTA wrote: hello everybody i am new to this mailing list. this is my first mail to this group. i jussst want to confirm that whether is it possible to update a view or not?? There is no automatic updating of views at present. You can write your own RULES though to do updates - see t