From: hazlup <robjsargent@gmail.com>
To: Help-gnu-emacs@gnu.org
Subject: sql-postgres input from create function generates 'sql help' listing
Date: Fri, 2 Oct 2009 06:55:34 -0700 (PDT) [thread overview]
Message-ID: <25716253.post@talk.nabble.com> (raw)
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.
next reply other threads:[~2009-10-02 13:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-02 13:55 hazlup [this message]
2009-10-06 13:21 ` sql-postgres input from create function generates 'sql help' listing Thien-Thi Nguyen
2009-10-06 14:53 ` hazlup
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=25716253.post@talk.nabble.com \
--to=robjsargent@gmail.com \
--cc=Help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.