Re: [SQL] Permission on insert rules

2002-11-12 Thread Robert Treat
This should be a test case for what Luis wants, although it works in 7.2.1 so maybe not. Luis, if this isn't what your trying to do, you'll need to post some code: create table parent (id int, name text, misc text); create view child as select id,name from parent; create rule jammasterjay as on

Re: [SQL] Postgres Date pg_dump/Import:

2002-11-12 Thread Martin Crundall
Tom; IT WORKED! This is what I did: env | grep CFLAGS and that produced all those flags as you predicted (-O9 -funroll-loops -ffast-math -malign-double -mcpu=pentiumpro -march=pentiumpro) unset CFLAGS make clean ./configure --enable-odbc make make install a subsequent pg_dump of the

Re: [SQL] Postgres Date pg_dump/Import:

2002-11-12 Thread Tom Lane
"Martin Crundall" <[EMAIL PROTECTED]> writes: > Not sure how to tell. I didn't explicitly specify anything like this > during the ./configure step of install. Poking around in the souce > directory, I pulled this out of config.cache ... > configure:1243: checking whether the C compiler (gcc -O9

Re: [SQL] Postgres Date pg_dump/Import:

2002-11-12 Thread Martin Crundall
Tom; Not sure how to tell. I didn't explicitly specify anything like this during the ./configure step of install. Poking around in the souce directory, I pulled this out of config.cache ... configure:1243: checking whether the C compiler (gcc -O9 -funroll-loops -ffast-math -malign-double -mcpu

Re: [SQL] Inconsistent or incomplete behavior obverse in where

2002-11-12 Thread Josh Berkus
Paul, > Thanks for the reply. Much of what you say is as we expected. > I see that 7.3 has addressed the "Unable to identify an operator > '=' for types 'numeric' and 'double precision'" problem, but > I'm not sure how. Context-sensitive approach? Overloaded operator > approach? Something e

Re: [SQL] Inconsistent or incomplete behavior obverse in where

2002-11-12 Thread Paul Ogden
Josh, Thanks for the reply. Much of what you say is as we expected. I see that 7.3 has addressed the "Unable to identify an operator '=' for types 'numeric' and 'double precision'" problem, but I'm not sure how. Context-sensitive approach? Overloaded operator approach? Something else ( is the

Re: [HACKERS] [SQL] Inconsistent or incomplete behavior obverse in where

2002-11-12 Thread Tom Lane
"Josh Berkus" <[EMAIL PROTECTED]> writes: > Now, that's interesting. Why would defining a "numeric = float" have > broken "numeric = integer"? There's no reason I can think of. The problem probably is that the parser now finds two possible interpretations that look equally good to it, so it ca

Re: [SQL] Output of function into a file

2002-11-12 Thread Rajesh Kumar Mallah.
in 7.3 you will be able to return multiple rows with multiple columns. 7.3 stable is going to be out soon as it in beta 5 stage currently. regds mallah. On Saturday 09 November 2002 11:00, karthick v wrote: > Hi, > > I am writing a small function to manipulate records in multiple > tables. Si

Re: [SQL] Inconsistent or incomplete behavior obverse in where clause

2002-11-12 Thread Tom Lane
Paul Ogden <[EMAIL PROTECTED]> writes: > select count(wuid) from WU where wuActive = 0.0 --throws the > following exception: > "Unable to identify an operator '=' for types 'numeric' and 'double > precision' You will have to retype this query using an explicit cast" This is fixed as of 7.3. (

Re: [SQL] Inconsistent or incomplete behavior obverse in where

2002-11-12 Thread Josh Berkus
Paul, > "Unable to identify an operator '=' for types 'numeric' and 'double > precision' You will have to retype this query using an explicit cast" This is due, as you surmised, to decimal values defaulting to floats. While there is little problem with an = operator for numeric and float, you wo

[SQL] Inconsistent or incomplete behavior obverse in where clause

2002-11-12 Thread Paul Ogden
Hello, Our application development group has observed what we feel is inconsistent behavior when comparing numeric column references to constant/literal values in SQL. I would appreciate comments on the best approach to this problem that will allow for the highest portability of our applicati

Re: [SQL] Permission on insert rules

2002-11-12 Thread Josh Berkus
Luis, > That's what I already made. The problem is when I do the update, I > permission denied in all the tables for update and insert. The user > that's making this operation only have select privilege. > Any way, I'm using version 7.2.1-2 for debian. I can't reproduce the problem, and permissio

Re: [SQL] Permission on insert rules

2002-11-12 Thread Luis Sousa
Josh Berkus wrote: Luis, Just a question. I'm writing some rules to insert/update some data in my database, and I gave all the privileges on that view to the user, and only select on the tables. When that user inserts data using the view, I thought that was user postgres that will do the r

Re: [SQL] Permission on insert rules

2002-11-12 Thread Luis Sousa
Robert Treat wrote: On Fri, 2002-11-08 at 21:40, Bruce Momjian wrote: Josh Berkus wrote: Luis, Just a question. I'm writing some rules to insert/update some data in my database, and I gave all the privileges on that view to the user, and only select on the tables. When that user

Re: [SQL] Permission on insert rules

2002-11-12 Thread Luis Sousa
Bruce Momjian wrote: Josh Berkus wrote: Luis, Just a question. I'm writing some rules to insert/update some data in my database, and I gave all the privileges on that view to the user, and only select on the tables. When that user inserts data using the view, I thought that was user p

Re: [SQL] Efficient ON DELETE trigger when referential integrity is

2002-11-12 Thread Stephan Szabo
On Tue, 12 Nov 2002, [iso-8859-1] Cédric Dufour (Cogito Ergo Soft) wrote: > Hello, > > I am trying to figure out how to handle tuple deletion efficiently when ON > DELETE triggers and referential integrity are involved. The scenario is > about this one: > > I have a MASTER and a SLAVE table, the l

Re: [SQL] averaging interval values

2002-11-12 Thread Christoph Haller
> > 1:01:01 > 0:25:15 > 7:09:01 > 8:09:05 > > Is there any way to average or sum those above values using a > function? > > i could not type cast the varchar(40) to interval type. > > How to change the datatype of field from varchar to interval? > Try SELECT CAST(CAST (t2 AS TEXT) AS INTERVAL) FR

[SQL] averaging interval values

2002-11-12 Thread praveen vejandla
Hi All, I have a table with one varchar field that contains time intervals. Is there any way to average or sum those intervals in a table ? Table name : test field name : t2 (varchar(40)) it contains all intervals as below t2 1:01:01 0:25:15 7:09:01 8:09:05 Is there any way to average or

Re: [SQL] Output of function into a file

2002-11-12 Thread Christoph Haller
> > I am writing a small function to manipulate records in multiple > tables. Since the function cannot return more than one value, I would > like to get all the outputs of the queries and append them into a text > file. > > Is there any way to do it inside the function. I came across many > pos

Re: [SQL] execute a query in an other db

2002-11-12 Thread Bruno Wolff III
On Sat, Nov 09, 2002 at 17:51:40 +0100, LR <[EMAIL PROTECTED]> wrote: > Hi, > > When I'm connected to a postgreSQL db ( e.g. myDB ), how could I execute > "select * from myTable;" in an other db (e.g. myOtherDB). > > In other words, what is the postgreSQL equivalent of the MS SQL Server > state

Re: [SQL] parse bug

2002-11-12 Thread Achilleus Mantzios
On Mon, 11 Nov 2002 [EMAIL PROTECTED] wrote: > > seems like an error in the sql parser to me: > > # create table test (acol smallint[]); > CREATE > # insert into test (acol) values ('{ 0 }'); > ERROR: pg_atoi: error in "0 ": can't parse " " > # insert into test (acol) values ('{ 0}'); > INSERT 28

Re: [SQL] CREATE VIEW (dynamically)

2002-11-12 Thread Christoph Haller
> CREATE FUNCTION "requests_insert_after" () RETURNS opaque AS ' > DECLARE > view_name text; > BEGIN > view_name := ''request_'' || NEW.id; > CREATE VIEW view_name AS select * from groups; > return NEW; > END' LANGUAGE 'plpgsql'; > > CREATE TRIGGER "requests_insert_aft

[SQL] Efficient ON DELETE trigger when referential integrity is involved ?

2002-11-12 Thread Cédric Dufour
Hello,   I am trying to figure out how to handle tuple deletion efficiently when ON DELETE triggers and referential integrity are involved. The scenario is about this one:   I have a MASTER and a SLAVE table, the latter referencing the former through a "FOREIGN KEY ... REFERENCES ... ON DELET

[SQL] parse bug

2002-11-12 Thread floyds
seems like an error in the sql parser to me: # create table test (acol smallint[]); CREATE # insert into test (acol) values ('{ 0 }'); ERROR: pg_atoi: error in "0 ": can't parse " " # insert into test (acol) values ('{ 0}'); INSERT 28472 1 the only difference is the trailing " " after the 0;

[SQL] CREATE VIEW (dynamically)

2002-11-12 Thread Emmanuel Engelhart
code << CREATE FUNCTION "requests_insert_after" () RETURNS opaque AS ' DECLARE view_name text; BEGIN view_name := ''request_'' || NEW.id; CREATE VIEW view_name AS select * from groups; return NEW; END' LANGUAGE 'plpgsql'; CREATE TRIGGER "requests_insert_after"

[SQL] Output of function into a file

2002-11-12 Thread karthick v
Hi, I am writing a small function to manipulate records in multiple tables. Since the function cannot return more than one value, I would like to get all the outputs of the queries and append them into a text file. Is there any way to do it inside the function. I came across many postings which

[SQL] execute a query in an other db

2002-11-12 Thread LR
Hi, When I'm connected to a postgreSQL db ( e.g. myDB ), how could I execute "select * from myTable;" in an other db (e.g. myOtherDB). In other words, what is the postgreSQL equivalent of the MS SQL Server statement "USE myOtherDB SELECT * FROM myTable" ? Thanks Lilian ---

Re: [SQL]

2002-11-12 Thread Richard Huxton
On Tuesday 12 Nov 2002 7:22 am, [EMAIL PROTECTED] wrote: > HI, > > Can someone pls help us with the following problem? > > Any help would be appreciated. > > Is stored procedures will return muliple rows in postgresql. > If so a sample example is needed. With current versions of PG, look into re

[SQL] Efficient ON DELETE trigger when referential integrity is involved ?

2002-11-12 Thread Cédric Dufour (Cogito Ergo Soft)
Hello,   I am trying to figure out how to handle tuple deletion efficiently when ON DELETE triggers and referential integrity are involved. The scenario is about this one:   I have a MASTER and a SLAVE table, the latter referencing the former through a "FOREIGN KEY ... REFERENCES ... ON DELET