Re: [SQL] ERROR: column "crc" does not exist

2007-04-12 Thread George Weaver
Original Message From: <[EMAIL PROTECTED]> I have a table with many fields and the latest field is: "CRC" character varying(255), ^^ Select * from base.points where crc = 'e19e26330a0db2f2435106b16623fa82' What happens when you enter: Select * from base.points where "CRC" = 'e19e26

Re: [SQL] Triggers using PL/pgSQL

2006-07-31 Thread George Weaver
- Original Message - From: Aaron Bono To: John DeSoi I don't think so but there was some discussion a week or two ago about mixing variables and using execute. I am curious, does anyone >know what the "best" approach is? Also, I did not address deletions. If you still need to d

Re: [SQL] Error when trying to use a FOR loop

2006-07-20 Thread George Weaver
- Original Message From: "Kevin Nikiforuk" xp512-0715-0716=# FOR LV in 1..10 LOOP It appears that you are trying to use the For .. Loop structure from the psql command line. This structure is not plain SQL - its meant to be used within PL/pgSQL. Have you tried incorporating it int

Re: Fwd: [SQL] Start up question about triggers

2006-06-23 Thread George Weaver
Hi Fotis, If you end up having to create a solution for each of the 80 tables, you may want to check out the following (may also give you addtional ideas for what you're trying to achieve): http://www.varlena.com/GeneralBits/104.php (Logging Audit Changes with Composite Typed Columns). Reg

Re: [SQL] Problems Testing User-Defined Function

2006-06-09 Thread George Weaver
- Original Message - From: "Rommel the iCeMAn" <[EMAIL PROTECTED]> I am trying to pass the following values to the function but I have been so far unsuccessful. What error message are you receiving? SELECT sp_insert_manifest('me', [EMAIL PROTECTED]', '[EMAIL PROTECTED]', 'test.t

Re: [SQL] CREATE VIEW form stored in database?

2006-02-13 Thread George Weaver
- Original Message - From: "Mario Splivalo" <[EMAIL PROTECTED]> If you keep your definition in a script file, you can copy the script and paste it into pgAdmin's Execute Arbitrary SQL Queries window, and then execute the script from there. It's still a pain. If I have two dozen vie

Re: [SQL] CREATE VIEW form stored in database?

2006-01-31 Thread George Weaver
- Original Message - From: "Mario Splivalo" <[EMAIL PROTECTED]> Yes, I'm tied to the pgadmin3 for the moment, so there's nothing I could do. It's a pain to develop a database such way. Mario, If you keep your definition in a script file, you can copy the script and paste it into pg

Re: [SQL] SYNTAX ERROR ON FOR... LOOP

2005-04-27 Thread George Weaver
Hi Rodrigo, - Original Message - From: "Rodrigo Carvalhaes" <[EMAIL PROTECTED]> To: Sent: Wednesday, April 27, 2005 12:39 PM Subject: [SQL] SYNTAX ERROR ON FOR... LOOP Hi Guys, I am having a "simple syntax problem" but very strange... I am trying to make an IF / ELSE / END IF inside of

Re: [SQL] Query performance problem

2005-03-18 Thread George Weaver
Only specifying a default value does not prevent a NULL from being entered either through accident or ignorance: jan28-05=# create table test (foo text, foo1 int4 default(0)); CREATE TABLE jan28-05=# insert into test values('a',1); INSERT 98685 1 jan28-05=# insert into test values('b',4); INSERT

Re: [SQL] Generic Function

2005-03-15 Thread George Weaver
- Original Message - From: <[EMAIL PROTECTED]> To: Sent: Monday, March 14, 2005 12:15 PM Subject: [SQL] Generic Function Hi, Can I built a generic function like: CREATE FUNCTION f (text) RETURNS TEXT as $$ return 'select * from $1'; $$ I know its impossible as writed. Also I have lo

Re: [SQL] Working with XML.

2005-02-23 Thread George Weaver
riginal Message - From: Theo Galanakis To: 'George Weaver' Cc: 'pgsql-sql@postgresql.org' Sent: Tuesday, February 22, 2005 4:13 PM Subject: Re: [SQL] Working with XML. George,       I have run this SP in Cold Fusion, PgAdmin and EMS PostgreSQL M

Re: [SQL] Working with XML.

2005-02-22 Thread George Weaver
worked as expected.   Perhaps the client you're using is causing the problem.  Can you run the query in pgAdmin?   Regards, George - Original Message - From: Theo Galanakis To: 'George Weaver' Cc: 'pgsql-sql@postgresql.org' Sent: Monday, Febr

Re: [SQL] Working with XML.

2005-02-21 Thread George Weaver
Title: Message Hi Theo,There have been 2 major changes between the 7 and 8 versions that affect the coding in xml2.  You need to edit the source code in order for it to compile properly on 7.First, work_mem has to be changed to SortMem (line 666).  I.e.    tupstore = tuplestore_begin_heap(tr

Re: [SQL] Working with XML.

2005-02-15 Thread George Weaver
perly - I should be able to help you with that.  I don't think you can use it on any version earlier than 7.2.   Regards, George - Original Message - From: Theo Galanakis To: 'George Weaver' Sent: Tuesday, February 15, 2005 4:30 PM Subject: RE: [SQL] Workin

Re: [SQL] Working with XML.

2005-02-15 Thread George Weaver
:13:18''}2d4mat2Lptmdydtgqnc5vnuzxgqxiykqn1c4pr0oduk5gwz25b3Lq05dzqxetee9om45b69ytb48uvziL5xrvyu4k7ng4oouihx0764929641215{ts ''2005-02-14 16:13:18''}1z5x6dLc9n1vtcLbmk7q6hdriqLa2ub4et41podr7izcro4nkkLsvp9p0s7obzr27txvknn92m0ps4riqqx7puqoLn2wpmm2z50r'jan28-05(# ,&

Re: [SQL] Working with XML.

2005-02-14 Thread George Weaver
Title: Working with XML. Hi Theo,   I am not aware of any means of passing xml to stored procedures, apart from writing your own function to parse the xml.   In regard to your second question - how to access the second record - try using a more explicit xpath query incorporating a "where" co

Re: [SQL] PL/PgSQL - returning multiple columns ...

2005-02-02 Thread George Weaver
Hi Marc, One option is to create a simple data type and return the rowtype of the datatype eg CREATE TYPE tserverload AS ("server_name" text, "load_avg" int4); CREATE FUNCTION getserverload() RETURNS tserverload AS 'DECLARE r tserverload%rowtype; etc. You would then return r, comprise

Re: [SQL] Returning A Varchar From A Function

2004-08-16 Thread George Weaver
Hi Richard, What happens if you just do: where trim(status) = trim($1) Regards, George - Original Message - From: "Richard Hurst" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, August 12, 2004 4:04 AM Subject: [SQL] Returning A Varchar From A Function > Hi > > this has

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

2004-04-21 Thread George Weaver
David, I tend to use \ to escape things like ' - I find it makes it somewhat easier to debug. What about: sql_string :=\' INSERT INTO temp_table ( view_name, row_count ) SELECT \' || r_rec.viewname || \', count(*) FROM \' ||

Re: [SQL] Looks are important

2003-11-13 Thread George Weaver
Hi Tom, Switching to a fixed-width font did the trick. Thanks for the help. George - Original Message - From: "Tom Lane" <[EMAIL PROTECTED]> To: "George Weaver" <[EMAIL PROTECTED]> Cc: "Josh Berkus" <[EMAIL PROTECTED]>; <[EMAIL PRO

Re: [SQL] Looks are important

2003-11-12 Thread George Weaver
oncatenate the two as they are being displayed as one column in a drop down combobox.   Is what I'm trying to do possible???   George - Original Message - From: Louise Cofield To: 'George Weaver' ; [EMAIL PROTECTED] Sent: Wednesday, November 12, 2003 5:19 P

[SQL] Looks are important

2003-11-12 Thread George Weaver
Hi Everyone,   I am trying to concatenate two fields through a query:   SELECT RPAD(no,30,' ') || tableb.kind FROM tablea  WHERE tablea.kind = tableb.kind   The result gives (for example):   4595448   Green5966  Yellow106-60033   

Re: [SQL] Dynamic Query for System functions - now()

2003-11-10 Thread George Weaver
Kumar, What about this: EXECUTE 'select now()+ interval \' || to_char(3,\'9\') || \'month\' '; George - Original Message - From: "Kumar" <[EMAIL PROTECTED]> To: "Christoph Haller" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, November 10, 2003 5:57 AM Subject: Re: [SQL] Dyn

Re: [SQL] Object description at Client Window

2003-10-17 Thread George Weaver
Kumar, pg_class.relname is type "name". You are trying to compare it to p_tablename which is type "varchar". Try changing your function definition to: CREATE OR REPLACE FUNCTION public.desc_table(name) HTH George SNIP > CREATE OR REPLACE FUNCTION public.desc_table(varchar) > RETURNS re

Re: [SQL] Possible to have array as input paramter for a function?

2003-10-08 Thread George Weaver
Hi Kumar,   Looks like I got up too early this morning - please ignore my previous reply re: varchar(30) (I was looking at the wrong function :-(  ).   I do use arrays in Pl/pgSQL functions, and have defined them as you did, e.g. varchar[], which does not return an error.  What version of P

Re: [SQL] Possible to have array as input paramter for a function?

2003-10-08 Thread George Weaver
Hi Kumar,   It is possible to pass an array to a PL/pgSQL function, but I believe you must specify the length of the array (at least doing so works for me). E.g. "varchar(20)".   Regards, George - Original Message - From: Kumar To: psql Sent: Wednesday, October 08, 2003

Re: [SQL] Bad encoding in URL

2003-10-07 Thread George Weaver
>From the manual: replace(string text, from text, to text) text Replace all occurrences in string of substring from with substring to replace('abcdefabcdef', 'cd', 'XX') abXXefabXXef HTH. George - Original Message - From: "HR" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Mo

Re: [SQL] Problem with Escape charactor

2003-10-07 Thread George Weaver
Kumar,   Have you tried   EXECUTE 'update "WATS".action_plan_master set rec_deleted_flag =  \'Y\' WHERE action_plan_id IN ('|| p_action_plan_ids || ')';^  ^   HTH, George - Original Message - From: Kumar

Re: [SQL] Capturing pgsql ERRORS/NOTICES to file

2003-09-26 Thread George Weaver
Hi Wei, I hadn't tried that, and it did the trick! Thank you! George - Original Message - From: "Wei Weng" <[EMAIL PROTECTED]> To: "George Weaver" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, September 26, 2003 2:16 PM Subject:

Re: [SQL] Capturing pgsql ERRORS/NOTICES to file

2003-09-26 Thread George Weaver
Hi Josh, Thanks for the reply. What I am trying to achieve is to have errors go to a file, rather than show up on the screen. Is this possible? George - Original Message - From: "Josh Berkus" <[EMAIL PROTECTED]> To: "George Weaver" <[EMAIL PROTECTE

[SQL] Capturing pgsql ERRORS/NOTICES to file

2003-09-26 Thread George Weaver
I am in the process of creating a batch file that will update some functions in a database for a remote user similar to:   psql -o output dbname < functionupdate.sql   Is there any way to save any ERROR and NOTICE messages to a file?    The -o option doesn't capture this information.   Tha

Re: [SQL] [GENERAL] plPGSQL bug in function creation

2003-09-08 Thread George Weaver
I had the same success using 7.3.2 with Cygwin: e=# SELECT functest1('A','B'), functest1(null,'B'), functest2('A','B'), functest2(null,'B'); functest1 | functest1 | functest2 | functest2 ---+---+---+--- A | B | A | B (1 row) e=# select ve

Re: [SQL] Help me

2003-09-04 Thread George Weaver
Hi Yaroslav,   You must set the language as:     LANGUAGE 'plpgsql';   Regards, George - Original Message - From: Yaroslav Ulyanov To: [EMAIL PROTECTED] Sent: Thursday, September 04, 2003 2:46 AM Subject: [SQL] Help me Hello   I cannot write new functio

Re: [SQL] Strange behavior with timestamptz

2003-08-26 Thread George Weaver
zle this one through as well). Sorry for the confusion. George - Original Message - From: "George Weaver" <[EMAIL PROTECTED]> To: "Tom Lane" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, August 25, 2003 9:51 PM Subject: Re: [SQL] Strange be

Re: [SQL] Strange behavior with timestamptz

2003-08-26 Thread George Weaver
) conventions (1 row) In both cases the month is being sent to the stored procedure first, but in the first instance (month < 13) it is being interpreted as the day. George - Original Message - From: "Tom Lane" <[EMAIL PROTECTED]> To: "George Weaver" &l

[SQL] Strange behavior with timestamptz

2003-08-25 Thread George Weaver
Hi Everyone,   I have a situation where two tables have a "Created" field defined as follows:   table seedlot "created  timestamptz  DEFAULT now(), "   table transaction"created  timestamptz  NOT NULL  DEFAULT now(),"   The transaction table records when a seedlot record

Re: [SQL] ALTER TABLE ... DROP CONSTRAINT

2003-07-30 Thread George Weaver
It works in 7.3.2.   George - Original Message - From: Elielson Fontanezi To: pgsql-general ; pgsql-sql Sent: Wednesday, July 30, 2003 10:52 AM Subject: [SQL] ALTER TABLE ... DROP CONSTRAINT Hi all!       Who can tell me what postgres version supports

Re: [SQL] "record" datatype - plpgsql

2003-05-30 Thread George Weaver
Brian, You can also use the "record" type as well in the same way. George - Original Message ----- From: "George Weaver" <[EMAIL PROTECTED]> To: "Brian Knox" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, May 29, 2003 2:01 PM Subje

Re: [SQL] "record" datatype - plpgsql

2003-05-30 Thread George Weaver
Hi Brian; Assuming "NEW" has been declared as foo%rowtype, you can access the columns thus NEW.xxx where xxx is the column name HTH. George - Original Message - From: "Brian Knox" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, May 29, 2003 11:11 AM Subject: [SQL] "re