Re: Issue with psqlrc with command line.

2018-08-30 Thread saurabh shelar
Hi David, Got your point. Thank you for the help. On Wed, Aug 29, 2018 at 9:07 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Wed, Aug 29, 2018 at 8:31 AM, saurabh shelar > wrote: > >> Hi David, >> >> Thank you for the help. >> >> I was just got confused with the below line men

Ways to deal with large amount of columns;

2018-08-30 Thread a
Hi all: I need to make a table contains projected monthly cashflow for multiple agents (10,000 around). Therefore, the column number would be 1000+. I would need to perform simple aggregate function such as count, sum or average on each cashflow projected. So if there is anyway of doing

Re: pg_upgrade fails saying function unaccent(text) doesn't exist

2018-08-30 Thread Gunnlaugur Thor Briem
Thank you! That got the pg_upgrade to completion. But then during ./analyze_new_cluster.sh vacuum fails thus: vacuumdb: processing database "dm_test": Generating minimal optimizer statistics (1 target) vacuumdb: vacuuming of database "dm_test" failed: ERROR: text search dictionary "unaccent" does

Re: Ways to deal with large amount of columns;

2018-08-30 Thread David G. Johnston
On Thursday, August 30, 2018, a <372660...@qq.com> wrote: > Hi all: > > I need to make a table contains projected monthly cashflow for multiple > agents (10,000 around). > > Therefore, the column number would be 1000+. > > I would need to perform simple aggregate function such as count, sum or > a

Re: Ways to deal with large amount of columns;

2018-08-30 Thread Andreas Kretschmer
Am 30.08.2018 um 11:13 schrieb a: Therefore, the column number would be 1000+. just as a additional note: there is a limit, a table can contains not more than 250-100 columns, dependsing on column types. https://wiki.postgresql.org/wiki/FAQ Regards, Andreas -- 2ndQuadrant - The PostgreSQ

Re: Ways to deal with large amount of columns;

2018-08-30 Thread Robert Zenz
As David said, you'd be better off having a table that looks like this (in terms of columns): * MONTH * AGENT * CASHFLOW So your query to get the sum of a single agent would be looking like: select sum(CHASFLOW) where AGENT = 'Agent' and MONTH between values;

Re: Ways to deal with large amount of columns;

2018-08-30 Thread Andreas Kretschmer
Am 30.08.2018 um 15:15 schrieb Robert Zenz: As David said, you'd be better off having a table that looks like this (in terms of columns): * MONTH * AGENT * CASHFLOW So your query to get the sum of a single agent would be looking like: select sum(CHASFLOW) where

Re: pg_upgrade fails saying function unaccent(text) doesn't exist

2018-08-30 Thread Adrian Klaver
On 08/30/2018 02:24 AM, Gunnlaugur Thor Briem wrote: Thank you! That got the pg_upgrade to completion. But then during ./analyze_new_cluster.sh vacuum fails thus: vacuumdb: processing database "dm_test": Generating minimal optimizer statistics (1 target) vacuumdb: vacuuming of database "dm_tes

Re: pg_upgrade fails saying function unaccent(text) doesn't exist

2018-08-30 Thread Gunnlaugur Thor Briem
\dFd unaccent List of text search dictionaries Schema | Name | Description +--+- public | unaccent | (1 row) \dFd+ unaccent List of text search dictionaries Schema | Name |Template |Init options| Description +--

searching a value in a variable/field in all tables in a schema

2018-08-30 Thread Ruiqiang Chen
Does anyone have experience of searching a value in a variable/field in all tables in a schema? If you can provide some code not creating stored procedure that would be great. Thanks, Ray

Re: searching a value in a variable/field in all tables in a schema

2018-08-30 Thread David G. Johnston
On Thu, Aug 30, 2018 at 1:44 PM, Ruiqiang Chen wrote: > Does anyone have experience of searching a value in a variable/field in > all tables in a schema? > SELECT 'Tbl1'::text AS loc, fld FROM schema.tbl1 WHERE fld = 'value' [UNION ALL SELECT 'Tbl2'::text AS loc, fld FROM schema.tbl2 WHERE fld =

Re: Ways to deal with large amount of columns;

2018-08-30 Thread Tim Cross
a <372660...@qq.com> writes: > Hi all: > > > I need to make a table contains projected monthly cashflow for multiple > agents (10,000 around). > > > Therefore, the column number would be 1000+. > > Not sure your data model is correct. Typically, with something like this, increasing the number

Re: Ways to deal with large amount of columns;

2018-08-30 Thread a
Hi thanks for your mail. So my data is arranged as this due to the nature of business. I need the projected cash flow in each agent to calculate such as present value or other related issue to report to regulator. Furthermore, some basic functions such as sum, average and other aggregate funct

Re: Ways to deal with large amount of columns;

2018-08-30 Thread a
Thank you very much. Creating a function seems to be a good idea :) -- Original message -- From: "David G. Johnston"; Sendtime: Thursday, Aug 30, 2018 8:31 PM To: "a"<372660...@qq.com>; Cc: "pgsql-general"; Subject: Re: Ways to deal with large amount of column

Re: searching a value in a variable/field in all tables in a schema

2018-08-30 Thread Ruiqiang Chen
Thanks! On Thu, Aug 30, 2018 at 4:51 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Thu, Aug 30, 2018 at 1:44 PM, Ruiqiang Chen > wrote: > >> Does anyone have experience of searching a value in a variable/field in >> all tables in a schema? >> > > SELECT 'Tbl1'::text AS loc, fld

Re: Ways to deal with large amount of columns;

2018-08-30 Thread Tim Cross
On Fri, 31 Aug 2018 at 10:47, a <372660...@qq.com> wrote: > Thank you very much. Creating a function seems to be a good idea :) > > > -- Original message -- > *From:* "David G. Johnston"; > *Sendtime:* Thursday, Aug 30, 2018 8:31 PM > *To:* "a"<372660...@qq.com>; >