Re: [GENERAL] Unable to add a new column to a table named "in" (look like a bug ...)

2008-04-17 Thread David Gagnon
Forget about what I said .. I can see the IN and in table in pgadmin III .. IN is the first one... sorry about that:-) David -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Unable to add a new column to a table named "in" (look like a bug ...)

2008-04-17 Thread David Gagnon
EY, btree (innum) reference=# -Message d'origine- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Adam Rich Envoyé : Thursday, April 17, 2008 10:33 AM À : 'David Gagnon'; pgsql-general@postgresql.org Objet : Re: [GENERAL] Unable to add a new column to a table na

Re: [GENERAL] Unable to add a new column to a table named "in" (look like a bug ...)

2008-04-17 Thread David Gagnon
u gave me. Thanks again David -Message d'origine- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Adam Rich Envoyé : Thursday, April 17, 2008 10:15 AM À : 'David Gagnon'; pgsql-general@postgresql.org Objet : Re: [GENERAL] Unable to add a new column to a table

[GENERAL] Unable to add a new column to a table named "in" (look like a bug ...)

2008-04-17 Thread David Gagnon
I all, Could you just have a look to the output below? I try to add a column to a table named "in" (I know "in" is a reserved keyword but the table exists and I cannot change it). Postgresql complains that the column already exist but it didn't. Am I doing something wrong ? Thanks to point me

[GENERAL] Is there a way to elegantly do a : CREATE TEMP TABLE X AS SELECT .... ON COMMIT DROP

2008-03-13 Thread David Gagnon
Hi all, I think the title says everything:-) I just what a way to create a TEMP for the current transaction only. If possible I don't want to create the TEMP table first, specify all column types, etc. CREATE TEMP TABLE _T_CR1 AS SELECT CRNUM, CRYPNUM, CRMONT, CRDATE, GLNUM, CRRRNUM, CRAC

[GENERAL] how to convert a string array to a string. fct array_to_string seem to work only for INT array??

2007-05-10 Thread David Gagnon
Hi all, I'm messing with this, I think simple, problem. I searched the doc and the web without success .. hum I have a string array(Compte[]) and I need to create the following string statement to populate a temporary table statement := ' INSERT INTO T_CR1 ( CRNUM, CRMONT, CSGLNUM, CRDATE)

Re: [GENERAL] select ARRAY[1,4,3] @> ARRAY[3,1] gives ERROR: operator does not exist: integer[] @> integer[] ???

2007-02-27 Thread David Gagnon
Dam! my computer rebooted and restarted the old 8.1 postmaster... Thanks for your help. Sorry for the noise. Best Regards David -Message d'origine- De : Tom Lane [mailto:[EMAIL PROTECTED] Envoyé : Tuesday, February 27, 2007 11:02 AM À : David Gagnon Cc : pgsql-general@postgresq

[GENERAL] select ARRAY[1,4,3] @> ARRAY[3,1] gives ERROR: operator does not exist: integer[] @> integer[] ???

2007-02-27 Thread David Gagnon
Hi all, I tried select ARRAY[1,4,3] @> ARRAY[3,1] in pgAdminIII and get an error. This example comes directly from the postgresql manual section: 9.14. Array Functions and Operators. Did I screw up something ? I tried on a 8.1 postgreql and get the same error. ERROR: operator does not exist:

[GENERAL] how to sort an array and remove duplicate in plpgsql

2007-02-26 Thread David Gagnon
Hi all, I'm messing up with this problem for a while and I searched the web without success. I have an array of timestamp and I needed sorted and I need to remove duplicate value. The Select statement offers the SORT BY and UNIQUE that may help me but so far I didn't find the way to plug my ar

Re: [GENERAL] PostgreSQL theoretical maximums.

2006-07-27 Thread David Gagnon
Hi, Have a look at: http://www.postgresql.org/about/ /David Karen Hill wrote: How many tables can PostgreSQL theoretically and then practically handle? What is the largest database size possible? What was the biggest database you've ever had on PostgreSQL? What were the challenges and what

[GENERAL] BUG when migrating from 8.0 to 8.1 with create temp table

2005-11-28 Thread David Gagnon
Hi all, I just migrated from 8.0 to 8.1 and one of my stored procecure just hang when trying to create a temp table Here is my call: select * from usp_Comptabilite_AgeDeCompteClient('M', null, '2005-01-28', '1', '1', '0', null) If you look below in the log you will see that the function j

Re: [GENERAL] BUG when migrating from 8.0 to 8.1 with create temp table:SORRY MY

2005-11-28 Thread David Gagnon
The log was not written I think Sorry for the noise /David David Gagnon wrote: Hi all, I just migrated from 8.0 to 8.1 and one of my stored procecure just hang when trying to create a temp table Here is my call: select * from usp_Comptabilite_AgeDeCompteClient('M', null, &

Re: [GENERAL] pl/pgsql list as parameter.

2005-11-04 Thread David Gagnon
Hi, Here is an example Regards /David CREATE OR REPLACE FUNCTION usp_Inventaire_Transaction_Statut_Changer(int[], varchar, int, date) RETURNS INTEGER AS ' DECLARE requestIds ALIAS FOR $1; companyId ALIAS FOR $2; targetStatus ALIAS FOR $3; transactionDate ALIAS FOR $4; transactionDate_ timest

Re: [GENERAL] Problem with array in plpgsql function .. please help

2005-11-03 Thread David Gagnon
Hi When I call the same function select * from usp_Commande_Dues_Retourner('{\'1734\'}', 'M', '2005-02-02', '2005-11-02', 'EN' ); with the real line I get no result? Why are you quoting the value inside the quotes? Because I had a bug in my java application. I modify my code to

[GENERAL] Problem with array in plpgsql function .. please help :-)

2005-11-02 Thread David Gagnon
Hi all, I cannot find what is the problem with my function below. The following line in the function :AND PD.PDPONUM = ANY (receivingIds) don't work. If I change this line byAND PD.PDPONUM = 1734 (Hardcode a given value) I get a result row. When I call the same function select

[GENERAL] Problem with UPDATE .. FROM syntax. please help

2005-11-01 Thread David Gagnon
Hi all, I mess around with this request below. Has is I get the following error. 2005-11-01 16:08:41 ERROR: JOIN/ON clause refers to "pd", which is not part of JOIN The error came from the following line: INNER JOIN BD ON PD.PDBDNUM = BD.BDNUM AND PD.PDYPNUM = BD.BDYPNUM But when I remov

Re: [GENERAL] the best way to catch table modification

2005-10-25 Thread David Gagnon
Hi, I posted on the same subject a month ago . .you can search for the current title in the JDBC mailing list [JDBC] implementing asynchronous notifications PLEASE CONFIRM MY I ended using statement-level trigger. I haven't found another way to do it . Regards /David Marek Lewczuk wrote:

Re: [GENERAL] Why UPDATE gl SET gl.glnum = gl.glnum; cause error when UPDATE gl

2005-07-08 Thread David Gagnon
d" is ambiguous /David P.S.: It's just an example .. I rename the column in the real statement to make it works. Bruno Wolff III wrote: On Fri, Jul 08, 2005 at 09:59:03 -0400, David Gagnon <[EMAIL PROTECTED]> wrote: Hi all, I was juste wondering why the foll

[GENERAL] Why UPDATE gl SET gl.glnum = gl.glnum; cause error when UPDATE gl SET glnum = glnum; is OK ?

2005-07-08 Thread David Gagnon
Hi all, I was juste wondering why the following code don't work: UPDATE gl SET gl.glnum = gl.glnum ERROR: column "gl" of relation "gl" does not exist While the following works: UPDATE gl SET glnum = glnum; Query returned successfully: 177 rows affected, 281 ms execution time. the TABLE.COLUMN

[GENERAL] Postgresql is not able to find a stored procedure with a smallint instead of integer in signature

2005-07-07 Thread David Gagnon
Hi, I messed around with the following problem and just want to let you know. I have the following function: -CREATE OR REPLACE FUNCTION usp_inventaire_transaction_inserer("varchar", "varchar", int2, "varchar", "varchar", "varchar", int4, "timestamp", "timestamp", "numeric", "numeric"

Re: [GENERAL] double entries into database when using IE

2005-07-05 Thread David Gagnon
vascript_ in forms all the time to interact with a PostgreSQL database, and don't have any issues like this with debugged code, using IE6. Susan

Re: [GENERAL] double entries into database when using IE

2005-07-05 Thread David Gagnon
Hi, I have seen IE posting request twice to the server when you post using a button that use javascript. Per example, if you have a submit button and call a javascript that actually post the form... IE will still do the post attached to the submit button. So you will have 2 submits It's

Re: [GENERAL] Explain Analyse never returns .. maybe a bug

2005-06-30 Thread David Gagnon
Oups ! Sorry I misunderstanding the command .. always thought it was almos instantaneous my mistake.. really sorry about that Thanks :-) /David Sean Davis wrote: - Original Message - From: "David Gagnon" <[EMAIL PROTECTED]> Cc: Sent: Wednesday, June 29, 2005

[GENERAL] Explain Analyse never returns .. maybe a bug

2005-06-29 Thread David Gagnon
Hi all, I stop the following statement after 3 minutes explain analyse select * From IC where IC.ICNUM NOT IN (select IRICNUM from IR WHERE IRSTATUT in (1, 2)) I'm using 8.0.3 on windows. Is that a know bug ? Thanks /David P.S.: I can send more info if needed.

Re: [GENERAL] Deletes and large tables

2005-06-10 Thread David Gagnon
This table has 3 foreign keys, but that should not matter during deletes. In addition, the tables being referred to are small, and should be in cache. I'm talking about FK that point this table... Not FK defined for this table that point to other table. If Table A is referenced by 10 other

Re: [GENERAL] Deletes and large tables

2005-06-10 Thread David Gagnon
Hi, You have any foreign keys pointing this table ? That's the problem I got when I wanted to delete all rows from a table with 5 FK. You may search my name in the list archive and found the thread on this matter. Ciao /David Edmund Dengler wrote: Greetings! We have a table with more

[GENERAL] How to reduce disk usage and found where disk usage is used? + reindex force doesn`t seem to work

2005-04-26 Thread David Gagnon
Hi all, I'll really appreciate any help to reduce the disk usage of postgresql. I have a web site witch is data are refreshed each night. Right now the disk usage is about 400 Megs but since I reload data all nights it getting huge. I do vacuum each time I am finished loading data. I look into

Re: [GENERAL] Regular expression. How to disable ALL meta-character

2005-04-21 Thread David Gagnon
e mycol ~* ('***=' || X) For the test I did it doesn't, fit all my need. No meta character and no escaping to do on X before launching the SQL request. Thanks for your help!!! Have a great day /David Chris Travers wrote: David Gagnon wrote: Maybe there is a simple way to to thi

Re: [GENERAL] Regular expression. How to disable ALL meta-character

2005-04-20 Thread David Gagnon
Hi Scott, I would generally scrub the input before it go to postgresql. Basically do a simple string_replace type function that replaces anything that ISN'T alphanum with nothing. If I change the original string the user may not get what he expects as result. abc[d] is not the samething tha

Re: [GENERAL] Regular expression. How to disable ALL meta-character

2005-04-20 Thread David Gagnon
Michael Fuhr wrote: On Wed, Apr 20, 2005 at 11:28:28AM -0400, David Gagnon wrote: I have a web interface with offers a search field. This search field will look for the string X in 12 different columns. If the string is found anywhere I return the row. The problem is that the user is eable

[GENERAL] Regular expression. How to disable ALL meta-character in a regular expression

2005-04-20 Thread David Gagnon
Hi all, I have a web interface with offers a search field. This search field will look for the string X in 12 different columns. If the string is found anywhere I return the row. The problem is that the user is eable to put spacial character like : [* This create invalid regular expression an

Re: [GENERAL] Improvement for COPY command .. unless it already exists

2005-04-07 Thread David Gagnon
/David Tom Lane wrote: David Gagnon <[EMAIL PROTECTED]> writes: Is there a way to specify default values in the COPY command? There's always ALTER TABLE ... SET DEFAULT. regards, tom lane ---(end of broadcast)

[GENERAL] Improvement for COPY command .. unless it already exists (If yes please tell me!)

2005-04-07 Thread David Gagnon
Hi all, Thanks for your reply on my yesterday's question regarding UTF-8 as a UNICODE implementation in postgresql. Is there a way to specify default values in the COPY command? In my example example VDVSSRC and VDVSNUM are the same for the 150 rows of the file. If it was possible to def

[GENERAL] COPY command use UTF-8 encoding and NOT UNICODE(16bits)... please confirm. Should postgresql add :set CLIENT_ENCODING to 'UTF-8'; to avoid confusion

2005-04-06 Thread David Gagnon
Hi all,   I ran into this problem and want to share and have a confirmation. I tried to use COPY function to load bulk data.  I craft myself a UNICODE file from a MSSQL db.  I can't load it into the postgresql.  I always get the error: CONTEXT:  COPY vd, line 1, column vdnum: "ÿþ1" The probl

Re: [GENERAL] [JDBC] plpgsql function with RETURNS SETOF refcursor

2005-03-24 Thread David Gagnon
or returning by CallableStatement .. I'm not sure correctly written to handle my problem. Kris Jurka wrote: On Thu, 24 Mar 2005, David Gagnon wrote: Hi Kris, I don't get error with the rsTmp.close() statement but with " (rsTmp.next()) ". The arraycopy is because I want to shri

Re: [GENERAL] [JDBC] plpgsql function with RETURNS SETOF refcursor AS. How to

2005-03-24 Thread David Gagnon
rs = new ResultSet[1]; rs[0] = (ResultSet) rsTmp.getObject(1); rsTmp.close(); return rs[0]; } Kris Jurka wrote: On Thu, 24 Mar 2005, David Gagnon wrote: I'm already able to get Refcursor from a stored procedure. But now I need to get a SETOF refcursor and I

[GENERAL] plpgsql function with RETURNS SETOF refcursor AS. How to get it work via JDBC

2005-03-24 Thread David Gagnon
Hi all, I'm already able to get Refcursor from a stored procedure. But now I need to get a SETOF refcursor and I can't make it work... Is that possible to do this via JDBC? He is the code I did. The rsTmp.next() throws a Connection is closed. Operation is not permitted. Exception. pu

Re: [GENERAL] I'm OWNER of the db but I get `permission denied` when

2005-03-23 Thread David Gagnon
Thanks It's the problem. /David Richard Huxton wrote: David Gagnon wrote: Hi all, I just created a new db wich userX is owner. I log via pgAdminIII with the same user but I can't update the pg_class. UPDATE pg_class SET reltriggers = 0 WHERE relname = 'ic' I get:ERROR: p

[GENERAL] I'm OWNER of the db but I get `permission denied` when doing updating table pg_class ???? Any help appreciated

2005-03-23 Thread David Gagnon
Hi all, I just created a new db wich userX is owner. I log via pgAdminIII with the same user but I can't update the pg_class. UPDATE pg_class SET reltriggers = 0 WHERE relname = 'ic' I get:ERROR: permission denied for relation pg_class I do that on my dev env. The only difference I saw beetwee

Re: [GENERAL] Problem with special character ï

2005-03-15 Thread David Gagnon
Hi Gnari, I'll do some more test tonight to figure out if it's a tomcat problem and I'll get back to you with this info. Thanks! /David maybe some difference in the environments that the two tomcats run in? are their locales the same ? gnari ---(end of broadcast)

Re: [GENERAL] Problem with special character ï on

2005-03-14 Thread David Gagnon
I did tried to update the stored-procedure via PgadminIII and it worked. The problem seems to be JDBC driver .. But all works well on my TOMCA/POSTGRESL/WINDOWS platform. I think it's something in the database setting .. is there other setting that can cause this behavior ? Thanks! /David --

Re: [GENERAL] Problem with special character ï on

2005-03-14 Thread David Gagnon
lay";"0" "commit_siblings";"5" "cpu_index_tuple_cost";"0.001" "cpu_operator_cost";"0.0025" "cpu_tuple_cost";"0.01" "DateStyle";"ISO, MDY" "db_user_namespace";"off" "deadlock_t

Re: [GENERAL] Problem with special character ï on

2005-03-14 Thread David Gagnon
en`t found either Thanks /David Ragnar Hafstaà wrote: On Mon, 2005-03-14 at 16:32 -0500, David Gagnon wrote: Hi, I really have a problem with a production environment (RH 9, Postgresql 7.4). When I deploy on the production env the same stored procedure with the same data (differ

[GENERAL] Problem with special character (Ã) on postgresql 7.4... getting out of idea .. please help :-)

2005-03-14 Thread David Gagnon
Hi, I really have a problem with a production environment (RH 9, Postgresql 7.4). When executing a stored procedure on my computer (development environment: 7.4 under cygwin. ) everything is oki When I deploy on the production env the same stored procedure with the same data (different OS and

Re: [GENERAL] preoblem in jdbc postgresql and tomcat

2005-03-14 Thread David Gagnon
Hi, I see 2 jdbc version in your classpath pg73jdbc3.jar and pg74.215.jdbc3.jar. For Tomcat you just have to drop the jdbc Jar file in /usr/local/jakarta-tomcat-4.1.31/common/lib No classpath to change.. Nothing. After create an entry in Server.xml or create a Context.xml to define your datasou

[GENERAL] quote_literal Simple question

2005-02-18 Thread David Gagnon
Hi all, I did a stored procedure and ran into this small problem. Here itemIdValue may be null and I would have expected quote_literal to returns null as a string or the value quoted. For now I think it returns a real null. This causes my function to crash. insertStatement:= ''INSERT INTO

[GENERAL] proper use of temp table in function

2004-11-30 Thread David Gagnon
Hi all, Sorry to ask since I'm pretty sure this kind of question have been asked again an again. But I searched and haven't found my answer. So here is the question, please help :-) In plpgsql function how do you deal with temporary table. I need do a bunch of data manipulations in my functi