[GENERAL] ?????? [GENERAL] SP to calc shipments vs receipts

2013-09-23 Thread DDT
hello, is the output calculated by following rule? on_hand SUM(receipt) - SUM(shipment) - SUM(allocated) available SUM(receipt) - SUM(shipment) sql can be: sum(case when trans_type='REC' then trans_qty when trans_type IN ('SHP', 'ALL') then -trans_qty else 0) as on_hand sum(case when trans_type=

[GENERAL] ??????[GENERAL] SP to calc shipments vs receipts

2013-09-25 Thread DDT
elf character varying(2), > matrix character varying(2), > CONSTRAINT ss_item_tran_key PRIMARY KEY (id) > > You'all have me thinking. Thanks for taking time to > educate me. > > > On Tue, 2013-09-24 at 14:22 +0800, DDT wrote: > > hello, is the output calculated

[GENERAL] Re: [GENERAL] ??????[GENERAL] SP to calc shipments vs receipts

2013-09-25 Thread DDT
thanks. -- Original -- From: "Chris Travers";; Date: Wed, Sep 25, 2013 10:46 PM To: "DDT"<410845...@qq.com>; Cc: "bret_stern"; "pgsql-general"; Subject: Re: [GENERAL] ??[GENERAL] SP to calc shipments vs

Re: [GENERAL] Deduplication and transaction isolation level

2013-09-25 Thread DDT
Is your table have only pkey one field and the sql is the exact same sql you use? If you have more than one field to insert, DISTINCT ensure the whole row values set are distinct instead of one field value. that't maybe a reason for your situation. -- Original --

Re: [GENERAL] Need help how to manage a couple of daily DB copies.

2013-10-24 Thread DDT
Dear, Append following command to crontab: D=`date -d -5day +"%Y%m%d"`;echo "DROP DATABASE test_db_$D" | psql Maybe you should change the "psql" to your psql path. -- Original -- From: "Andreas";; Date: Fri, Oct 25, 2013 09:53 AM To: "pgsql-general";

Re: [GENERAL] Replication and fsync

2013-10-24 Thread DDT
Dear According to manual, when you set "synchronous_commit" to on, the transaction commits will wait until master and slave flush the commit record of transaction to the physical storage, so I think even if turn off the fsync on master is safe for data consistency and data will not be lost if s