Re: [GENERAL] retrieve grouping sets/rollup rows

2016-03-13 Thread Tom Smith
exactly what I am looking for. very nice. Thx On Sun, Mar 13, 2016 at 10:44 PM, Tom Lane wrote: > >> On 03/13/2016 10:07 PM, Tom Smith wrote: > >>> It would help if the resultset has some param to mark which is which > >>> with the grouping sets index. > > I think you're looking for the GROUPIN

Re: [GENERAL] retrieve grouping sets/rollup rows

2016-03-13 Thread James Keener
/me has learned something new! Thanks! On 03/13/2016 10:44 PM, Tom Lane wrote: >>> On 03/13/2016 10:07 PM, Tom Smith wrote: It would help if the resultset has some param to mark which is which with the grouping sets index. > > I think you're looking for the GROUPING() function. See >

Re: [GENERAL] retrieve grouping sets/rollup rows

2016-03-13 Thread Tom Lane
>> On 03/13/2016 10:07 PM, Tom Smith wrote: >>> It would help if the resultset has some param to mark which is which >>> with the grouping sets index. I think you're looking for the GROUPING() function. See http://www.postgresql.org/docs/9.5/static/functions-aggregate.html

Re: [GENERAL] retrieve grouping sets/rollup rows

2016-03-13 Thread James Keener
It just dawned on me that you may note have meant having them in a specific sequence in the result set. Even still, I think it's much more clear being explicit with what rows are included and which aren't. Jim On 03/13/2016 10:12 PM, James Keener wrote: > Why? You're already provided with this i

Re: [GENERAL] enum bug

2016-03-13 Thread Alvaro Herrera
Elein wrote: Hi Elein, >* When an insert into an enum column fails give the person a hint as to > valid values > -- Lousy message. Show enum list. > insert into badinfo values ('green'); > ERROR: invalid input value for enum rainbow: "green" > LINE 1: insert into badinfo values ('green');

Re: [GENERAL] enum bug

2016-03-13 Thread Melvin Davidson
The post refers to the generic unmanageability of enums in genaral, it just uses MySQL as a reference basis. Google evil enum and you will find several articles that all say the same thing. To be specific,even in PostgreSQL, there is no easy way to delete enum values once they exist, other than pla

Re: [GENERAL] retrieve grouping sets/rollup rows

2016-03-13 Thread James Keener
Why? You're already provided with this information: NULL fields are not being used in the grouping set for the row. Moreover, it would seem to be an implementation- and run-time- dependent value, as there is no reason group by grouping set (a,b), (c,d) couldn't be executed in written order, or (c,d

Re: [GENERAL] enum bug

2016-03-13 Thread Alvaro Herrera
Melvin Davidson wrote: > Enums are evil! > http://www.lornajane.net/posts/2010/is-enum-evil ??? This post is about MySQL's enums, which aren't really related to Postgres enums: "In order to change the allowed values of an enum column, we need to issue an alter table statement [.

Re: [GENERAL] retrieve grouping sets/rollup rows

2016-03-13 Thread Tom Smith
It would help if the resultset has some param to mark which is which with the grouping sets index. for example, the results for (a,b,c,d) would be marked as for index =0, (b,c,d) would be index=1 On Sun, Mar 13, 2016 at 9:52 PM, James Keener wrote: > Do you want to know if a row is from the (a,b

Re: [GENERAL] Suppress decimal point like digits in to_char?

2016-03-13 Thread David G. Johnston
On Sunday, March 13, 2016, Ken Tanzer wrote: > > On Mar 13, 2016 6:29 PM, "David G. Johnston" > wrote: > > > > On Sunday, March 13, 2016, Ken Tanzer > wrote: > >> > >> Hi. Is there a way with to_char to suppress a decimal point, like a > leading or trailing 0, so that integers will not have th

Re: [GENERAL] retrieve grouping sets/rollup rows

2016-03-13 Thread James Keener
Do you want to know if a row is from the (a,b) or (c,d) group? All rows will contain (a,b,c,d) but (a,b) will be NULL for the (c,d) grouping sets, and vice-versa. Jim On 03/13/2016 09:45 PM, Tom Smith wrote: > Hello: > > With JDBC, how can I tell which row is for which grouping sets or rollup >

[GENERAL] retrieve grouping sets/rollup rows

2016-03-13 Thread Tom Smith
Hello: With JDBC, how can I tell which row is for which grouping sets or rollup using result sets Thanks

Re: [GENERAL] Suppress decimal point like digits in to_char?

2016-03-13 Thread Ken Tanzer
On Mar 13, 2016 6:29 PM, "David G. Johnston" wrote: > > On Sunday, March 13, 2016, Ken Tanzer wrote: >> >> Hi. Is there a way with to_char to suppress a decimal point, like a leading or trailing 0, so that integers will not have them, but non-ints will? I'm hoping I'm missing something easy. T

Re: [GENERAL] Suppress decimal point like digits in to_char?

2016-03-13 Thread David G. Johnston
On Sunday, March 13, 2016, Ken Tanzer wrote: > Hi. Is there a way with to_char to suppress a decimal point, like a > leading or trailing 0, so that integers will not have them, but non-ints > will? I'm hoping I'm missing something easy. Thanks. > > Ken > > SELECT val,to_char(val::decimal(6,2),

[GENERAL] Suppress decimal point like digits in to_char?

2016-03-13 Thread Ken Tanzer
Hi. Is there a way with to_char to suppress a decimal point, like a leading or trailing 0, so that integers will not have them, but non-ints will? I'm hoping I'm missing something easy. Thanks. Ken SELECT val,to_char(val::decimal(6,2),'FM999,999D99') FROM ( SELECT 1 AS val UNION SELECT 1.05 AS

Re: [GENERAL] Distributed Table Partitioning

2016-03-13 Thread Melvin Davidson
I guess that would work if you used a view to combine both tables, but you would still need a BEFORE trigger to make sure DML goes to the appropriate table. Another solution might be to use dblink if you need to access the SATA table on the 2nd VPS, On Sun, Mar 13, 2016 at 11:37 AM, Leonardo M. Ra

Re: [GENERAL] index problems (again)

2016-03-13 Thread Geoff Winkless
On 12 March 2016 at 22:00, Peter J. Holzer wrote: > I don't think most people's data is perfectly distributed. But as you > say most data is probably within some deviation of being perfectly > distributed and as long as that deviation isn't too big it doesn't > matter. Is that how what I wrote ca

Re: [GENERAL] MongoDB 3.2 beating Postgres 9.5.1?

2016-03-13 Thread Oleg Bartunov
On Mar 11, 2016 4:40 PM, "Paul Jones" wrote: > > I have been running the EDB benchmark that compares Postgres and MongoDB. > I believe EDB ran it against PG 9.4 and Mongo 2.6. I am running it > against PG 9.5.1 and Mongo 3.2 with WiredTiger storage using 10,000,000 > JSON records generated by the

Re: [GENERAL] pg_restore fails

2016-03-13 Thread Francisco Olarte
Hi Karsten.. On Sun, Mar 13, 2016 at 12:09 AM, Karsten Hilbert wrote: > I am trying to pg_restore from a directory dump. > However, despite using > > --clean > --create > --if-exists > > I am getting an error because schema PUBLIC already exists. snip, snip Have y

Re: [GENERAL] Full text search question: "01.Bez." --> "Erster Bezirk"

2016-03-13 Thread Dane Foster
Hello, ​ On Sat, Mar 12, 2016 at 11:40 AM, Johann Höchtl wrote: > I fear I have an involved challenge concerning FTS. > > Assume I have the following text in a column: > > Graz,06.Bez.:Blah > > This parses as: > SELECT alias, description, token FROM ts_debug('german', > 'Graz,06.Bez.:Blah'); >

Re: [GENERAL] "brew services list" shows postgresql as "started", but can not connect to it

2016-03-13 Thread Tom Lane
Alexander Farber writes: > And "brew services list" reports it as "started": > postgresql started afarber > /Users/afarber/Library/LaunchAgents/homebrew.mxcl.postgresql.plist > And I can restart it: > # brew services restart postgresql > Stopping `postgresql`... (might take a while) >

Re: [GENERAL] Distributed Table Partitioning

2016-03-13 Thread Leonardo M . Ramé
El 13/03/16 a las 10:04, Peter J. Holzer escribió: On 2016-03-12 21:19:11 -0500, Melvin Davidson wrote: - Original Message - From: "Leonardo M. Ramé" To: "PostgreSql-general" Sent: Saturday, 12 March, 2016 8:25:01 PM Subject: [GENERAL] Distributed Table Partiti

Re: [GENERAL] "brew services list" shows postgresql as "started", but can not connect to it

2016-03-13 Thread Chris Ruprecht
Did you initialize the DB cluster (initdb -D /path/to/data)? Did you configure the installation (postgres.conf file)? Does homebrew.mxcl.postgresql where the data lives? when you run "ps -ef|grep -i postg", do you see the postmaster and other postgres executables running? > On Mar 13, 2016, at 0

Re: [GENERAL] Distributed Table Partitioning

2016-03-13 Thread Peter J. Holzer
On 2016-03-12 21:19:11 -0500, Melvin Davidson wrote: > - Original Message - > From: "Leonardo M. Ramé" > To: "PostgreSql-general" > Sent: Saturday, 12 March, 2016 8:25:01 PM > Subject: [GENERAL] Distributed Table Partitioning > > I have this problem: a Master tabl

[GENERAL] "brew services list" shows postgresql as "started", but can not connect to it

2016-03-13 Thread Alexander Farber
Hello! I am trying to move from (successfully) using VM Fusion with CentOS Linux image on Mac OSX "El Capitan" for web development to Homebrew: brew update brew install postgres brew tap homebrew/services This resulted in some files installed to /usr/local/Cellar/postgresql/9.5.1