Re: [SQL] Update is very slow on a bigger table

2004-04-15 Thread Tom Lane
Dimitar Georgievski <[EMAIL PROTECTED]> writes: > the process under which the update is running reports among the usual > process data "UPDATE waiting". I don't think the UPDATE is doing anything at all --- that ps output implies that it's waiting for some other backend to release an exclusive loc

[SQL] Update is very slow on a bigger table

2004-04-15 Thread Dimitar Georgievski
hi, i'm running an update procedure on a table with approximately 100,000 records. The problem is the procedure is running endlessly even when the update is very simple like in the following example: update mytable set client_id = 1 where mytable_id = 1 mytable_id is the primary key of mytable.

Re: [SQL] function returning array

2004-04-15 Thread Dennis
Joe Conway writes: dennis'# pParsed varchar[]; Make that last line: pParsed varchar[] := ''{}''; That initializes pParsed to an *empty* array. Otherwise pParsed is NULL, and when you attempt to extend a NULL array, e.g. "pParsed[1] = '

Re: [SQL] function returning array

2004-04-15 Thread Joe Conway
Dennis wrote: pg 7.4.1 I should have listed the source for the function. Here is a simplified parseString function and the foo that calls it. dennis=# create or replace function parseString (varchar, varchar) dennis-# RETURNS varchar[] AS ' dennis'# DECLARE dennis'#

Re: [SQL] Grant permission to all objects of user A to user B

2004-04-15 Thread Christoph Haller
> > Dear Friends, > > Postgres 7.3.2. > > I have an database with owner USRA who owns about 300 objects (tables and f= > unctions). Now I want to give 'ALL' permission to all the objects of USRA t= > o another database user USRB. > > If I use the grant i need to type all the objects as comma se

Re: [SQL] Row count after SELECT INTO?

2004-04-15 Thread Christoph Haller
> > Dear SQL and plPgSQL gurus, I seek for your wisdom. > > I have a variable assignment via SELECT INTO in my function, and I want > to separate 3 cases: > 1) no rows found; > 2) one row found; > 3) many rows found (ambiguous select). > > The first case is simple, I use FOUND variable for it. >

Re: [SQL] cursors and for loops?

2004-04-15 Thread Jan Wieck
Just FYI, recent versions of PG use cursors internally for PL/pgSQL FOR loops. So there is no danger for a procedure to run out of memory when looping over a huge result set ... at least not because of that. Jan Dennis wrote: Tom Lane writes: Something like LOOP FET

Re: [SQL] function returning array

2004-04-15 Thread Dennis
Tom Lane writes: "Dennis" <[EMAIL PROTECTED]> writes: I am trying to return an array from a function and don't seem to be having luck. Seems to work for me ... what PG version are you using? pg 7.4.1 I should have listed the source for the function. Here is a simplified parseString function and

Re: [SQL] problem porting MySQL SQL to Postgres

2004-04-15 Thread Martin Marques
El Jue 15 Abr 2004 07:25, Dan Field escribió: > I've stumbled across a query I don't quite understand the error message > for. > > This query is pulled from a working MySQL setup: > > SELECT > DEWEY_ID, DEWEY_HUNDREDS, DEWEY_TENS, DEWEY_ONES, DEWEY_POINT_ONES, > DEWEY_POINT_TENS, >

Re: [SQL] problem porting MySQL SQL to Postgres

2004-04-15 Thread Paul Thomas
On 15/04/2004 11:25 Dan Field wrote: I've stumbled across a query I don't quite understand the error message for. This query is pulled from a working MySQL setup: SELECT DEWEY_ID, DEWEY_HUNDREDS, DEWEY_TENS, DEWEY_ONES, DEWEY_POINT_ONES, DEWEY_POINT_TENS, DEWEY_POINT_HUNDREDS, DEWEY_POIN

Re: [SQL] problem porting MySQL SQL to Postgres

2004-04-15 Thread Reinoud van Leeuwen
On Thu, Apr 15, 2004 at 11:25:59AM +0100, Dan Field wrote: > I've stumbled across a query I don't quite understand the error message > for. > > This query is pulled from a working MySQL setup: > > SELECT > DEWEY_ID, DEWEY_HUNDREDS, DEWEY_TENS, DEWEY_ONES, DEWEY_POINT_ONES, > DEWEY_POINT_

[SQL] problem porting MySQL SQL to Postgres

2004-04-15 Thread Dan Field
I've stumbled across a query I don't quite understand the error message for. This query is pulled from a working MySQL setup: SELECT DEWEY_ID, DEWEY_HUNDREDS, DEWEY_TENS, DEWEY_ONES, DEWEY_POINT_ONES, DEWEY_POINT_TENS, DEWEY_POINT_HUNDREDS, DEWEY_POINT_THOUSANDS, DEWEY_TYPE, DEWEY_LANG,

Re: [SQL] [GENERAL] SQL script

2004-04-15 Thread Richard Huxton
On Thursday 15 April 2004 09:22, [EMAIL PROTECTED] wrote: > good day toall.. > imm running postgreSQL on linux. > my main goal is to create a script that will dump a data from our server > too my local PC. the content of the script would be execute sql command > in one shot: 1. dump data > 2. upd