all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* sql-postgres input from create function generates 'sql help' listing
@ 2009-10-02 13:55 hazlup
  2009-10-06 13:21 ` Thien-Thi Nguyen
  0 siblings, 1 reply; 3+ messages in thread
From: hazlup @ 2009-10-02 13:55 UTC (permalink / raw
  To: Help-gnu-emacs


This is a bit bizarre but sql-send-paragraph of my function def is generating
a summary of sql commands.

Though the function 'compiles' correctly, each line of the "values" list
apparently generates a call for help!


From sending this:

 CREATE OR REPLACE FUNCTION update_element_history()
RETURNS "trigger" AS
$BODY$
    DECLARE
        inserthist bool := 'false';
        sts text := OLD.status;
    BEGIN
    /* Apparently staff diddles with locked_by manually and doesn't want to
be held accountable,
       so we look at both to determine a check-in event*/	
    IF NEW.version != OLD.version AND OLD.locked_by IS NOT NULL AND
NEW.locked_by IS NULL THEN
        inserthist := 'true';
	/*check the convertables table for an instance of this element*/
	if conversion_in_progress(new.element_id) then
	    new.locked_by := 'conversionprocess';
	    raise warning 'would be converting';
	end if;
    END IF;
    IF inserthist THEN
        IF sts IS NULL THEN
            sts := 'unapproved';
        END IF;
        INSERT INTO elements_history(
            element_id,
            version,
            last_modified,
            username,
            comments,
            parent_collection,
            name,
            owner,
            status,
            xml_text
            ) VALUES (
	    	    quote_literal(OLD.element_id),
	    	    quote_literal(OLD.version),
		    quote_literal(OLD.last_modified),
		    quote_literal(COALESCE((OLD.last_username), '')),
		    quote_literal(COALESCE(OLD.comments, '')),
		    quote_literal(COALESCE(OLD.parent_collection,'')),
		    quote_literal(COALESCE(OLD.name, '')),
		    quote_literal(COALESCE(OLD.owner, '')),
		    quote_literal(sts),
		    quote_literal(OLD.xml_text)
		    );
    END IF;
    RETURN NULL;
END;
$BODY$
LANGUAGE 'plpgsql' VOLATILE;


I get 10 copies of 
acrestest$# 
ABORT        CHECKPOINT   COMMIT       DECLARE      END          GRANT       
LOCK         REASSIGN     REVOKE       SET          TRUNCATE     VALUES
ALTER        CLOSE        COPY         DELETE FROM  EXECUTE      INSERT      
MOVE         REINDEX      ROLLBACK     SHOW         UNLISTEN     WITH
ANALYZE      CLUSTER      CREATE       DISCARD      EXPLAIN      LISTEN      
NOTIFY       RELEASE      SAVEPOINT    START        UPDATE       
BEGIN        COMMENT      DEALLOCATE   DROP         FETCH        LOAD        
PREPARE      RESET        SELECT       TABLE        VACUUM       

-- 
View this message in context: http://www.nabble.com/sql-postgres-input-from-create-function-generates-%27sql-help%27-listing-tp25716253p25716253.html
Sent from the Emacs - Help mailing list archive at Nabble.com.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: sql-postgres input from create function generates 'sql help' listing
  2009-10-02 13:55 sql-postgres input from create function generates 'sql help' listing hazlup
@ 2009-10-06 13:21 ` Thien-Thi Nguyen
  2009-10-06 14:53   ` hazlup
  0 siblings, 1 reply; 3+ messages in thread
From: Thien-Thi Nguyen @ 2009-10-06 13:21 UTC (permalink / raw
  To: Help-gnu-emacs

() hazlup <robjsargent@gmail.com>
() Fri, 2 Oct 2009 06:55:34 -0700 (PDT)

                       quote_literal(OLD.element_id),
                       quote_literal(OLD.version),
                       quote_literal(OLD.last_modified),
                       quote_literal(COALESCE((OLD.last_username), '')),
                       quote_literal(COALESCE(OLD.comments, '')),
                       quote_literal(COALESCE(OLD.parent_collection,'')),
                       quote_literal(COALESCE(OLD.name, '')),
                       quote_literal(COALESCE(OLD.owner, '')),
                       quote_literal(sts),
                       quote_literal(OLD.xml_text)

These lines include the TAB (ASCII 0x9) character, which is probably
triggering the completion response from the inferior command interpreter.

You can either convert the TABs to spaces (M-x untabify),
or arrange for the subprocess to not trigger on TAB.

thi




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: sql-postgres input from create function generates 'sql help' listing
  2009-10-06 13:21 ` Thien-Thi Nguyen
@ 2009-10-06 14:53   ` hazlup
  0 siblings, 0 replies; 3+ messages in thread
From: hazlup @ 2009-10-06 14:53 UTC (permalink / raw
  To: Help-gnu-emacs




Thien-Thi Nguyen-6 wrote:
> 
> () hazlup <robjsargent@gmail.com>
> () Fri, 2 Oct 2009 06:55:34 -0700 (PDT)
> 
>                        quote_literal(OLD.element_id),
>                        quote_literal(OLD.version),
>                        quote_literal(OLD.last_modified),
>                        quote_literal(COALESCE((OLD.last_username), '')),
>                        quote_literal(COALESCE(OLD.comments, '')),
>                        quote_literal(COALESCE(OLD.parent_collection,'')),
>                        quote_literal(COALESCE(OLD.name, '')),
>                        quote_literal(COALESCE(OLD.owner, '')),
>                        quote_literal(sts),
>                        quote_literal(OLD.xml_text)
> 
> These lines include the TAB (ASCII 0x9) character, which is probably
> triggering the completion response from the inferior command interpreter.
> 
> You can either convert the TABs to spaces (M-x untabify),
> or arrange for the subprocess to not trigger on TAB.
> 
> thi
> 
> 
> 
> 
Exactly, thanks.  Started seeing this behaviour elsewhere.  I'm in the
process of moving to a new box so my set up isn't complete.  Thanks for your
help.


-- 
View this message in context: http://www.nabble.com/sql-postgres-input-from-create-function-generates-%27sql-help%27-listing-tp25716253p25770296.html
Sent from the Emacs - Help mailing list archive at Nabble.com.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-10-06 14:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-02 13:55 sql-postgres input from create function generates 'sql help' listing hazlup
2009-10-06 13:21 ` Thien-Thi Nguyen
2009-10-06 14:53   ` hazlup

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.