[SQL] Compute hash of a table?

2006-05-02 Thread Peter Manchev
Hi All I need to determine whether the content of a given table has changed from the previous time I've checked it. so, my initial idea is to calculate a hash value of the content of the whole table, may be with custom aggregate function or something. My question is: Is it possible to get t

Re: [SQL] join on a like

2006-05-02 Thread Sim Zacks
I guess the real question is: what is more efficient - a join on a LIKE or a PLPGSQL function that has 2 loops, 1 for each bottom level child and one that takes the substring of that child one character at a time to get each parent? It sounds like you are saying that the join will actaully use

[SQL] [ocpfree] For my direct Client Looking for Mainframe const urgently

2006-05-02 Thread Sachin
I am having a mainframe requirement. Following are the details contact me with resume , rate , contact details to : [EMAIL PROTECTED] SKILLSET : Cobol / CICS / DB2 / JCL LOCATION : Hartford, CT CLIENT : Leading Insurance company in Hartford Sachin P Kraftware Inc kraftware.com [EMAIL PROTEC

[SQL] join on a like

2006-05-02 Thread Sim Zacks
A friend suggested that I use the Like predicate as part of my join condition and I was wondering if that was wise. For example, I have a column that describes the level of an event. There is A,B,C and then they can have children, such as AA,AB,BA,BB and they can all have children as well. So

[SQL] i am getting error when i am using copy command

2006-05-02 Thread Penchalaiah P.
Hi ..   1)   I created one table 2) Create table penchal(id integer, name varchar(12),age integer); 3)   Then I inserted some values into this table……… 4) Insert into penchal values(1,’reddy’,2); 5)   Select * from penchal ; I used this statement to display the val

Re: [SQL] LinkedList

2006-05-02 Thread Ben K.
The problem is that your way, there is no indicated way to determine which node is which. For instance is you update any of your nodes then the node list would be out of order and your list would not work. I think the thinking is different here. The OP's list is ordered and has prev-next only,

Re: [SQL] ERROR: plan should not reference subplan's variable

2006-05-02 Thread Catalin Pitis
Hi Tom   Could you tell me when will 8.1.4 be released with the problem solved?   Thanks, Catalin  On 5/3/06, Tom Lane <[EMAIL PROTECTED]> wrote: "Catalin Pitis" <[EMAIL PROTECTED]> writes: > ERROR:  plan should not reference subplan's variableI've applied a patch for this; will be in 8.1.4.http://

Re: [SQL] grant select on database demo to user

2006-05-02 Thread A. Kretschmer
am 02.05.2006, um 20:32:54 -0700 mailte Bryce Nesbitt folgendes: > I find myself with long lists of tables > > grant select on xx_tax to user; > grant select on xx_trip to user; > grant select on xx_foo to user; > > Is there a way to grant to all tables, with a single grant? I know how N

Re: [SQL] Sorting aggregate column contents

2006-05-02 Thread Ben K.
It works fine. But I wouldn't like using subselect's, then if somebody else knows about an operator or something like that to put on the aggregator, please tell me. I think the nature of the f_concat makes it difficult to sort, since it simply adds the next value, so if the source table gives

Re: [SQL] grant select on database demo to user

2006-05-02 Thread Thusitha Kodikara
Hi,You could easily generate a script with the list of tables and the required grant information and then run it to give the necessary grants. (The list of tables may be obtained by querying tables in 'information_schema')Regards,-Thusitha -Original Message- From: [EMAIL PROTECTED] [mailto

[SQL] grant select on database demo to user

2006-05-02 Thread Bryce Nesbitt
I find myself with long lists of tables grant select on xx_tax to user; grant select on xx_trip to user; grant select on xx_foo to user; Is there a way to grant to all tables, with a single grant? I know how to do it in mysql, but not postgres. As close as I get it: #grant select on data

Re: [SQL] ERROR: plan should not reference subplan's variable

2006-05-02 Thread Tom Lane
"Catalin Pitis" <[EMAIL PROTECTED]> writes: > ERROR: plan should not reference subplan's variable I've applied a patch for this; will be in 8.1.4. http://archives.postgresql.org/pgsql-committers/2006-05/msg00016.php regards, tom lane ---(end of b

Re: [SQL] Sorting aggregate column contents

2006-05-02 Thread Everton Luís Berz
It works fine. But I wouldn't like using subselect's, then if somebody else knows about an operator or something like that to put on the aggregator, please tell me. Volkan YAZICI escreveu: On May 02 06:00, Everton Luís Berz wrote: Is it possible to sort the content of an aggregate text co

Re: [SQL] Sorting aggregate column contents

2006-05-02 Thread Bruno Wolff III
On Wed, May 03, 2006 at 00:13:40 +0300, Volkan YAZICI <[EMAIL PROTECTED]> wrote: > On May 02 06:00, Everton Luís Berz wrote: > > Is it possible to sort the content of an aggregate text column? > > > > Query: > > select s.name, ag_concat(c.name) from state s > > inner join city c on (c.idstate =

Re: [SQL] Sorting aggregate column contents

2006-05-02 Thread Volkan YAZICI
On May 02 06:00, Everton Luís Berz wrote: > Is it possible to sort the content of an aggregate text column? > > Query: > select s.name, ag_concat(c.name) from state s > inner join city c on (c.idstate = s.idstate) > group by s.name > order by s.name; IMHO, you can receive results ordered by using

[SQL] Sorting aggregate column contents

2006-05-02 Thread Everton Luís Berz
Is it possible to sort the content of an aggregate text column? Query: select s.name, ag_concat(c.name) from state s inner join city c on (c.idstate = s.idstate) group by s.name order by s.name; Result: name | ag_concat ---+--- RS| Porto Alegre, Gramado SP

Re: [SQL] ERROR: plan should not reference subplan's variable

2006-05-02 Thread Tom Lane
"Catalin Pitis" <[EMAIL PROTECTED]> writes: > ERROR: plan should not reference subplan's variable > Do you have any clue why does this happen? It's a bug :-(. Thanks for the test case --- I'll look into it tonight or tomorrow, if no one beats me to it. regards, tom lane

[SQL] ERROR: plan should not reference subplan's variable

2006-05-02 Thread Catalin Pitis
Hi *   I'm trying to run the following SQL statement on a PostgreSQL 8.1, installed on a Windows machine:   INSERT INTO PROJECT(PROJECT_ID,PROJECT_DESC) (SELECT MAX(PROJECT_ID),'MYPROJECT'FROM PROJECT WHERE NOT EXISTS  (  SELECT PROJECT_DESC FROM PROJECT WHERE PROJECT_DESC = 'MYPROJECT' ))   and I

[SQL] Creating nested functions with plpgsql

2006-05-02 Thread Jorge Godoy
Hi! Is it possible to create nested functions using plpgsql as the language? I'd like to avoid other dependencies if I can, besides using already written SQL code... There are lots of repetitive tasks that "subfunctions" would solve in a very elegant way, keeping code more readable and conc

Re: [SQL] Counting the rows INSERTed/UPDATEd?

2006-05-02 Thread Mario Splivalo
On Tue, 2006-05-02 at 09:13 +0100, Richard Huxton wrote: > Mario Splivalo wrote: > > I have found, I thinl, in the pg manual, the way to get the number of > > rows inserted/updated, from within the plpgsql. I can't find it anymore, > > is that still there, or I misread something earlier? > > http:

Re: [SQL] Counting the rows INSERTed/UPDATEd?

2006-05-02 Thread Richard Huxton
Mario Splivalo wrote: I have found, I thinl, in the pg manual, the way to get the number of rows inserted/updated, from within the plpgsql. I can't find it anymore, is that still there, or I misread something earlier? http://www.postgresql.org/docs/8.1/static/plpgsql-statements.html#PLPGSQL-STA