473,379 Members | 1,222 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Suppress output from function?

Whenever I run certain functions, such as the example below, the output
is either displayed in the terminal or emailed to be by cron, depending
on how I run it. Is there any way I can re-write the function, set some
psql parameters, etc, to ensure that the results aren't displayed? I've
checked some of the postgresql.conf logging properties and running psql
with quiet = true, but all to no avail. Anyone have any suggestions,
hints, ?

CREATE TYPE employeeType AS (empID INTEGER, updateDate DATE, bDate
INTEGER, val1 NUMERIC, val2 NUMERIC, val3 NUMERIC, val4 NUMERIC, favNum
NUMERIC);

CREATE OR REPLACE FUNCTION updateEmployeeData() RETURNS SETOF
employeeType AS '
DECLARE
rec RECORD;
BEGIN
FOR rec IN SELECT empID, updateDate, bDate, val1, val2 ,
val3, val4, favNum FROM newData LOOP
RETURN NEXT rec;
UPDATE currentData SET val1=rec.val1, val2=rec.val2,
val3=rec.val2, val4=rec.val4, favNum=rec.favNum, updateDate=rec.updateDate
WHERE empID=rec.empID;
END LOOP;
RETURN;
END;
' LANGUAGE 'plpgsql';

SELECT * FROM updateEmployeeData();
Thanks
Ron
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #1
1 2277
Ron St-Pierre <rs*******@syscor.com> writes:
Whenever I run certain functions, such as the example below, the output
is either displayed in the terminal or emailed to be by cron, depending
on how I run it. Is there any way I can re-write the function, set some
psql parameters, etc, to ensure that the results aren't displayed?


Add "> /dev/null" to the psql invocation in the cron script. You might
also want to add "-q" to suppress uninteresting comments on stderr,
while still hearing about any actual errors (in other words, I wouldn't
also route stderr to /dev/null...)

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Eric Nelson | last post by:
Hi folks, How do I suppress the console window in a console app? If I double-click the app from explorer, I'd like the window not to appear. Thanks, Eric
9
by: Doug Ly | last post by:
Hi, When I run this query using WinSQL to connect to a DB2 database, it gave me the warning: Error: SQLSTATE 01003: Null values were eliminated from the argument of a column function. ...
3
by: Philipp Staempfli | last post by:
Hello I have a project which includes different libraries. When I compile the project, I get a huge amount of the following linker warnings: --- warning LNK4204: "C:\...\Debug\vc70.pdb' is...
6
by: Ron St-Pierre | last post by:
Is there a way 'within' psql to suppress output? One of our cron scripts calls a sql file which contains various database commands (ALTER TABLEs, UPDATEs, etc) and various user-defined functions....
4
by: nick | last post by:
Is it possible to disable/suppress alert popups in javascript? I need to write a function that will loop through a form's inputs and "manually" fire their onchange events (if found). Some of those...
5
by: Luke Skywalker | last post by:
Hi to all, I need to suppress the function keys (F1, F2, F3 ecc.) to use these keys to do other operations within the web pages of my application. I wrote this code: ...
1
by: rn5a | last post by:
A custom server control has a Button. Namespace Confirm Public Class ShowConfirm : Inherits Button Private strConfirmMsg As String Public Property ConfirmMessage() As String Get...
14
by: fdu.xiaojf | last post by:
Hi, I'm writing a program which imports an external module writing in C and calls a function provided by the module to do my job. But the method produces a lot of output to the stdout, and this...
2
by: ZeeHseez | last post by:
Hi, I have written a webbrowser application in VB .net Framework 1.1. I would like to suppress javascript error messages. However, the silent property of the webbrowser control suppresses the...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.