Re: [SQL] slow DELETE queries

2002-06-24 Thread Denis
On Thursday 20 June 2002 05:01 pm, you wrote: > On Thu, 20 Jun 2002 15:23:53 +0200, Denis <[EMAIL PROTECTED]> wrote: > >I traced the queries slowing it all down to this snippet in the debug log: > >DELETE FROM phpbb_search_wordlist WHERE word_id IN ( > >SELECT word_id

Re: [SQL] Porting from PL/SQL to PLPGSQL

2003-08-24 Thread denis
pts, it prompts the user to enter its value. In Postgres, we do not have such option (so far i know). So, you can replace those with your desired values directly. Postgres supports Array type too. Although i haven't used it anyday.. you can try it out. HTH Denis - Original Message ---

Re: [SQL] how to preserve \n in select statement

2003-12-22 Thread Denis
Hi Richard.. If your users are required to fire only SELECT and no DML, you can do the following: BEGIN; execute the statements given by user ROLLBACK; This will not affect your SELECT and also if any malicious user gives DELETE statement, that will not have any impact too.. HTH Thanx Denis

[SQL] Initially Deffered - FK

2004-01-15 Thread Denis
constraint address_fk references contact(id) on delete cascade initially deferred, city text, pin text); Lets.. insert few data in it.. insert into contact values (1, 'Denis'); insert into contact values (2, 'Anand'); insert in

[SQL] Initially Deffered - FK

2004-01-18 Thread denis
constraint address_fk references contact(id) on delete cascade initially deferred, city text, pin text); Lets.. insert few data in it.. insert into contact values (1, 'Denis'); insert into contact values (2, 'Anand'); insert into contact

Re: [SQL] Initially Deffered - FK

2004-01-18 Thread denis
result. But, just issue commit and see, the result gets changed !! Is this behaviour rectified / changed in later release of PG (say 7.3 or 7.4) ? Any help will be appreciated. Thanx Denis - Original Message - From: "Stephan Szabo" <[EMAIL PROTECTED]> To: "Den

Re: [SQL] Left joins with multiple tables

2004-01-18 Thread Denis
Hi Colin, Try select id, name, a.field1, b.field2, c.field3 from people p left outer join a on (a.person_id = p id) left outer join b on (b.person_id = p.id) left outer join c on (c.person_id = p.id); HTH Denis - Original Message - From: "Coli

Re: [SQL] Initially Deffered - FK

2004-01-19 Thread Denis
Hi Stephan, Thanks for your reply. Will have to work on its workaround... Denis - Original Message - From: "Stephan Szabo" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, January 19, 2004 4:03 PM Subject: Re: [SQL] Init

Re: [SQL] Database diagram

2004-01-20 Thread Denis
Hi Ganesan, You can try ERWin (by CA). It creates Logical data model of the database. (though.. i haven't used it..) HTH Thanx Denis - Original Message - From: "Ganesan Kanavathy" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent

Re: [SQL] max timestamp

2004-02-16 Thread Denis
2-16 14:27:20.888205+05:30 (3 rows) HTH Thanx Denis - Original Message - From: "Michael Sterling" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, February 10, 2004 11:44 PM Subject: [SQL] max timestamp > i'm trying to get the max time st

Re: [SQL] Field list from table

2004-02-29 Thread Denis
To get the list.. use SELECT a.attname as "Columns" FROM pg_attribute a, pg_class c WHERE c.relname = '' AND a.attnum > 0 AND a.attrelid = c.oid ORDER BY a.attnum Thanx Denis - Original Message - From: "Jan Pips" <[EMAIL PROTECTED]>

Re: [SQL] transaction

2004-04-26 Thread denis
: update tempxitag set qty = qty + nqty where ccod = cccod GET DIAGNOSTICS nFound = ROW_COUNT; If nFound = 0 then insert into tempxitag( ccod, qty) values (cccod, nqty ); End if; HTH Denis - Original Message - From: Bruno

Re: [SQL] Syntax for cmd to EXEC...how many quotes?

2004-04-26 Thread denis
Try (to solve string terminating error ): sql_string := ''INSERT INTO temp_table ( view_name, row_count ) SELECT '' || r_rec.viewname || '', count(*) FROM '' || r_rec.viewname || '' ; '' ; BUT, you will be needing to

Re: [SQL] Order by YYYY MM DD in reverse chrono order trouble

2004-04-26 Thread denis
Hi, If you want to SORT descending considering multiple column, you need to spefify DESC after each column. Default is ASC. So, your present sorting is ASC, ASC and DESC You can specify 1 DESC, 2 DESC, 3 DESC HTH Denis - Original Message - From: <[EMAIL PROTECTED]> To: &

Re: [SQL] Can someone tell me why this statement is failing?

2004-04-26 Thread denis
Hi.. Your END_TIME_MINUTES condition fails.. 1082377320 <= 1082375100 HTH. Denis - Original Message - From: P A <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, April 20, 2004 2:01 AM Subject: [SQL] Can someone tell me why this

Re: [SQL] ORDER BY TIMESTAMP_column ASC, NULL first

2004-06-03 Thread Denis
Hi Rod, Try this ace=> create table test(name text, age int ); CREATE ace=> insert into test values ('Denis',26); INSERT 1823531 1 ace=> insert into test values (null,26); INSERT 1823532 1 ace=> select * from test order by name; name | age ---+- Denis | 2

[SQL] Are circular REFERENCES possible ?

2001-08-07 Thread Denis Bucher
! Postgres complains like "ERROR: Relation 'customers' does not exist" when creating 'shops'. Someone told me I should create a third table, ok, but in this case I loose the total control about my logic... Do you have a suggestion ? Thanks a lot in advance

[SQL] URGENT ! Nouveau virus

2001-09-18 Thread Denis Bucher
x27;informations, mais en attendant FERMEZ INTERNET EXPLORER ET NE L'OUVREZ PLUS Bonne soirée ! Denis Bucher ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

[SQL] URGENT ! Nouveau virus

2001-09-19 Thread Denis Bucher
Hello ! Ok... I wrote a small text against that virus just in case you need it ! http://www.horus.ch/virus180901.txt A bientôt ! Denis Bucher ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate

[SQL] Epoch extraction

2003-03-01 Thread Denis Arh
Title: Message When i extract epoch from field (timestamp(0) without time zone) I get the time that is set in that field plus one hour... Is that a bug or am I just missing something     Regards, Denis Arh

Re: [SQL] default operator class (PostgreSQL's error?)

2003-03-02 Thread Denis Zaitsev
I've found a reason! It's some namespace problem - there are other tho name_ops operator classes exist. My becomes third. All are the default for (their) type. And somewhere there is the issue. Renaming my operator class into, say, name_t_ops resolves the problem. Thanks for the info. --

Re: [SQL] Delete duplicates

2003-06-22 Thread Denis Arh
How to delete "real" duplicates? id | somthing --- 1 | aaa 1 | aaa 2 | bbb 2 | bbb (an accident with backup recovery...) Regards, Denis Arh - Original Message - From: "Franco Bruno Borghesi" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]&

[SQL] Very strange 'now' behaviour in nested triggers.

2003-07-26 Thread Denis Zaitsev
In short, the idea this example is to test for is to split a comma-separated value of some text attribute (given to the INSERT operator) and then insert a row for each of the parts of that text value. I've tried to do this thru a nested triggers approach. create table xxx ( s text, t tim

Re: [SQL] Very strange 'now' behaviour in nested triggers.

2003-07-26 Thread Denis Zaitsev
On Sat, Jul 26, 2003 at 03:14:16PM +0100, Richard Huxton wrote: > On Saturday 26 July 2003 14:39, Denis Zaitsev wrote: > > In short, the idea this example is to test for is to split a > > comma-separated value of some text attribute (given to the INSERT > > operator) and then

Re: [SQL] Very strange 'now' behaviour in nested triggers.

2003-07-26 Thread Denis Zaitsev
On Sat, Jul 26, 2003 at 10:31:44AM -0400, Tom Lane wrote: > Denis Zaitsev <[EMAIL PROTECTED]> writes: > > create table xxx ( > > s text, > > t timestamp > > default 'now' > > ); > > That's a dangerous way to define the

Re: [SQL] Very strange 'now' behaviour in nested triggers.

2003-07-27 Thread Denis Zaitsev
On Sun, Jul 27, 2003 at 08:47:16AM +0100, Richard Huxton wrote: > > No- 'now',now() and CURRENT_TIMESTAMP all stay fixed during a transaction. > The one that changes is timeofday() I think. See the "Functions and > Operators" section for details. Yes, indeed... Documentation describes this. And

[SQL] NEW and a subselect in a rule

2003-07-28 Thread Denis Zaitsev
So, I met such a problem: it's impossible to use NEW in a subselect used in a (non-select) rule. The error is: . Is this a way to do that newertheless (without using of a function, of course)? Thanks in advance. ---(end of broadcast)--- TIP 9: the

[SQL] Nonexistent NEW relation in some places of rules

2003-07-29 Thread Denis Zaitsev
In general, the task I'm trying to solve is to make a multiply inserts for a table on the one only insert for a view. It should be noted about the method of producing these multiply rows, that they depend on the VALUES given to that INSERT. So, the trivialized schema is: create function produc

Re: [SQL] Very strange 'now' behaviour in nested triggers.

2003-07-29 Thread Denis Zaitsev
On Sun, Jul 27, 2003 at 11:49:10AM -0400, Tom Lane wrote: > I put up a proposal in pgsql-hackers to change this behavior: > http://archives.postgresql.org/pgsql-hackers/2003-07/msg00818.php > If we made that change then the "wrong" way of defining the default > would fail in an obvious fashion ---

Re: [SQL] Nonexistent NEW relation in some places of rules

2003-07-30 Thread Denis Zaitsev
On Tue, Jul 29, 2003 at 06:32:44PM -0400, Tom Lane wrote: > The problem is that the rule gets expanded into something rather like > > insert into a select ... from new, produce(new.b); > > and we can't support that. If we ever add support for SQL99's > LATERAL(), it might help improve matt

Re: [SQL] NEW and a subselect in a rule

2003-08-01 Thread Denis Zaitsev
On Thu, Jul 31, 2003 at 10:00:07AM +0200, Christoph Haller wrote: > > > > So, I met such a problem: it's impossible to use NEW in a subselect > > used in a (non-select) rule. The error is: > > exist>. Is this a way to do that newertheless (without using of a > > function, of course)? > > > Coul

Re: [SQL] not really SQL but I need info on BLOBs

2004-05-09 Thread Denis Braekhus
p you should weigh the pros to the cons.. Regards - -- Denis -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.2-nr2 (Windows XP) iD8DBQFAnieIvsCA6eRGOOARAiwYAKCeaMfnq35nGoQRixKAsec/+k4kwwCdHy91 EyIqpTqWbZimUFdOjaFdpbI= =Uzfm -END PGP SIGNATURE- ---(end of broa

[SQL] Which SQL command creates ExclusiveLock?

2004-04-26 Thread Denis Khabas
Hi everyone!   I have a web application that uses Postgresql on backend. The application performs selects, updates, inserts, and deletes by using Hibernate. Tables contain indexed fields. When I run the following query, SELECT * FROM pg_locks, it shows that some transactions place Exclusive

Re: [SQL] mail alert

2009-08-11 Thread Denis BUCHER
. Therefore, first you have to know the requirements... Denis -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

[SQL] Question about encoding

2009-08-24 Thread Denis BUCHER
Hello, I'm sure you already replied tons of questions like this, but I don't understand something. This is the situation : * I have COPY commands from a dump, encoded as UTF8 (special characters are encoded as 2-bytes). * My file contains SET client_encoding = 'UTF8'; * But when I do psql http://

Re: [SQL] Question about encoding

2009-08-25 Thread Denis BUCHER
SET client_encoding = LATIN1. Anyway, finally everything is working again, I just had to add a SET NAMES LATIN1 to my application because it was ISO and not UTF8 aware. Therefore thanks a lot for your help, it solved all my problems ! Denis -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

[SQL] Problem with return type of function ???

2009-10-22 Thread Denis BUCHER
R $1; >row RECORD; > BEGIN > > FOR row IN > SELECT * FROM rma.serial_number WHERE sn=serialnumber > LOOP > RETURN NEXT row; > END LOOP; > > END; > $_$ > LANGUAGE plpgsql STRICT; Thanks a lot for any help ! Denis -- Sent via pgsql-sql mailing list (pg

Re: [SQL] Problem with return type of function ???

2009-10-22 Thread Denis BUCHER
: the difference in name is just a mistake in my email but in fact it is the same function, I just renamed it wrong when doing the "cleaning" before posting my email... Denis -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

[SQL] Problem with return type of function ??? (corrected)

2009-10-22 Thread Denis BUCHER
;serialnumber ALIAS FOR $1; >row RECORD; > BEGIN > > FOR row IN > SELECT * FROM rma.serial_number WHERE sn=serialnumber > LOOP > RETURN NEXT row; > END LOOP; > > END; > $_$ > LANGUAGE plpgsql STRICT; Thanks a lot for any help ! Denis --

Re: [SQL] Problem with return type of function ???

2009-10-22 Thread Denis BUCHER
sting my email... > > In that case - have you changed the definition of table > rma.serial_number since you defined the function? No, I just do the test just after the "CREATE OR REPLACE FUNCTION". I saw somwhere it could be the order of the fields ? Denis -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Problem with return type of function ???

2009-10-22 Thread Denis BUCHER
| > no_art_bw | character varying(11) | > sn_fc_date | date | > desc_fr | character varying(40) | > sn_cm_date | date | > no_facture | integer | > no_commande | integer | Denis -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Problem with return type of function ???

2009-10-22 Thread Denis BUCHER
what you asked and I tested it myself before sending. And I think I've found the problem (but not the solution !) : When I dump the FUNCTION, I get this : > CREATE test(character varying) RETURNS SETOF serial_number instead of this : > CREATE test(character varying) RETURNS SETOF

Re: [SQL] Problem with return type of function ??? (corrected)

2009-10-22 Thread Denis BUCHER
Hello Tom, Tom Lane a écrit : > Denis BUCHER writes: >> I have a strange problem, because it worked in a fonction for a table, >> and now I created the same (?) function for another table and it doesn't >> work... > >> The function is accepted but at runtime

Re: [SQL] Problem with return type of function ??? (corrected)

2009-10-22 Thread Denis BUCHER
Hi Tom, Another question : Tom Lane a écrit : > Denis BUCHER writes: >> I have a strange problem, because it worked in a fonction for a table, >> and now I created the same (?) function for another table and it doesn't >> work... > >> The functi

Re: [SQL] Problem with return type of function ??? (corrected)

2009-10-24 Thread Denis BUCHER
Tom Lane a écrit : > Denis BUCHER writes: >> To do this it will be a little complicated because of table >> dependencies... And it could bug again at the next DROP COLUMN... Is >> there a way to change my function (RETURN SETOF part) to specify the >> column names/

[SQL] EXISTS

2008-10-11 Thread Denis Woodbury
: 42601 Character: 2 Thanks denis woodbury [EMAIL PROTECTED] 450-242-0249 -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] EXISTS

2008-10-14 Thread Denis Woodbury
Thanks to those who responded, I see PL/PgSQL is the way to go Regards, denis woodbury on 10/11/08 1:32 PM, [NAME] at [ADDRESS] wrote: > Denis Woodbury <[EMAIL PROTECTED]> writes: >> I would like to know if this this type of statement can be used in >> Postgresql > &g

Re: [SQL] staggered query?

2004-04-21 Thread Denis P Gohel
Hi Try this.. SELECT Col1 , Col2 FROM yourtable WHERE to_number(to_char(col1, 'SS'),'99') / 10 ) in (10,20,30,40,50,00); HTH Denis > - Original Message - > From: Vincent Ladlad <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent:

[SQL] Record Lock details

2004-04-23 Thread Denis P Gohel
row. >From which data dictionary, i should query. Any help would be appreciated. Thanx Denis ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere&qu