Обсуждение: Triggers
I have a trigger on a table called stock_count (which has a column
barcode) which needs to update a value in a table called theoretical_stock_count on either an insert,
update or delete. However, I need to pass the barcode of the
inserted/updated/deleted row to the function I am calling. Is there any
way to do this?
Rob
--
He who dies with the most toys ...
... still dies
Rob,
> I have a trigger on a table called stock_count (which has a column
> barcode) which needs to update a value in a table called
> theoretical_stock_count on either an insert,
> update or delete. However, I need to pass the barcode of the
> inserted/updated/deleted row to the function I am calling. Is there
> any
> way to do this?
Within the Update or Delete trigger, the bar code of the original row
is available as OLD.barcode. For Update and Insert triggers, the new
record's barcode is available as NEW.barcode.
-Josh
______AGLIO DATABASE SOLUTIONS___________________________
Josh Berkus
Complete information technology josh@agliodbs.com
and data management solutions (415) 565-7293
for law firms, small businesses fax 621-2533
and non-profit organizations. San Francisco
I would like to add a couple of startup options to postgresql on my system, but am having difficulty modifying the RedHat startup scripts (in /etc/rc.d/init.d) I would like to add -i to allow network connections and -l for ssl traffic I think the line to modify is: su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -D $PGDATA -p /usr/bin/postmaster start > /dev/null 2>&1" < /dev/null I tried su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -D $PGDATA -p `/usr/bin/postmaster -i` start > /dev/null 2>&1" < /dev/null and su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -D $PGDATA -p '/usr/bin/postmaster -i' start > /dev/null 2>&1" < /dev/null and su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -D $PGDATA -p /usr/bin/postmaster -o "i" start > /dev/null 2>&1" < /dev/null with no luck Suggestions?
I am trying to get postgresql started by remote login. Ran this script #!/bin/sh exec /bin/su - postgres -c "/usr/bin/postmaster -D /usr/local/pgsql/data -i -B 4096 >> /usr/local/pgsql/server.log 2>&1" /dev/null And get this result: /usr/bin/postmaster does not find the database system. Expected to find it in the PGDATA directory "/usr/local/pgsql/data ", but unable to open file with pathname "/usr/local/pgsql/data/base/template1/pg_class". pg_class doesn't seem to be on the box although when I was physically present at the computer I think I was able to run psql and create a database. So I guess are there some programs that I can run remotely (as root or whatever) to get the postgres files set up? Thanks, Tom