[SQL] pg_dump not correctly saving schema with partitioned tables?

2012-01-31 Thread chester c young
have database with many partitions. each partition table has its own primary key sequence. Column || Modifiers ---++-- uno_id|| not null default

[SQL] must appear in the GROUP BY clause or be used in an aggregate function problem

2012-01-31 Thread Edward W. Rouse
Attempting to get a list of items that we want to be grouped by id and date, with a detail column. Table a is a typical user table; id, first and last name are all that I am using Table b is a tracking table, combining data from 8+ tables into one for ease of use for reporting purposes; id,

Re: [SQL] must appear in the GROUP BY clause or be used in an aggregate function problem

2012-01-31 Thread David Johnston
-Original Message- From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-ow...@postgresql.org] On Behalf Of Edward W. Rouse Sent: Tuesday, January 31, 2012 3:27 PM To: pgsql-sql@postgresql.org Subject: [SQL] must appear in the GROUP BY clause or be used in an aggregate function problem

Re: [SQL] must appear in the GROUP BY clause or be used in an aggregate function problem

2012-01-31 Thread Samuel Gendler
On Tue, Jan 31, 2012 at 12:27 PM, Edward W. Rouse ero...@comsquared.comwrote: And in most cases this works fine. The problem arises when invoices get added to the exception table due to their not being an invoice number. Even though we join on the tracking id, the group by on invoicenum lumps

Re: [SQL] pg_dump not correctly saving schema with partitioned tables?

2012-01-31 Thread Tom Lane
chester c young chestercyo...@yahoo.com writes: have database with many partitions. each partition table has its own primary key sequence. Column || Modifiers ---++--

Re: [SQL] must appear in the GROUP BY clause or be used in an aggregate function problem

2012-01-31 Thread Edward W. Rouse
I would love to remove most of the aggregate functions. I am trying to update an existing query to provide better data and started with the existing one (which is where the MAX for the names came from). I originally tried to remove those, but I get the group by/aggregate function error if I do. I

Re: [SQL] must appear in the GROUP BY clause or be used in an aggregate function problem

2012-01-31 Thread Edward W. Rouse
NM, I figured it out. The mere presence of an aggregate function and/or the group by clause is what's causing all the hate for me. I will take a whack at getting this to work without them. Thanks all. From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-ow...@postgresql.org] On Behalf Of

Re: [SQL] must appear in the GROUP BY clause or be used in an aggregate function problem

2012-01-31 Thread Samuel Gendler
On Tue, Jan 31, 2012 at 1:43 PM, Edward W. Rouse ero...@comsquared.comwrote: NM, I figured it out. The mere presence of an aggregate function and/or the group by clause is what’s causing all the hate for me. I will take a whack at getting this to work without them. Thanks all. All columns

Re: [SQL] must appear in the GROUP BY clause or be used in an aggregate function problem

2012-01-31 Thread Edward W. Rouse
Yeah, that's what I did. No more group by, the MAX is in a subquery. One of the reasons I hate coming behind someone else and updating their stuff is that too many people try to get cute with the code. I try to make everything as plain and simple as possible unless performance issues require

Fw: Re: [SQL] pg_dump not correctly saving schema with partitioned tables?

2012-01-31 Thread chester c young
From: chester c young chestercyo...@yahoo.com Subject: Re: [SQL] pg_dump not correctly saving schema with partitioned tables? To: Tom Lane t...@sss.pgh.pa.us Date: Tuesday, January 31, 2012, 5:40 PM --- On Tue, 1/31/12, Tom Lane t...@sss.pgh.pa.us wrote: From: Tom Lane

[SQL] Display Length Between Var Varchar

2012-01-31 Thread Carlos Mennens
I've noticed when I set a field to char, it takes up lots of space over varchar: iamunix=# SELECT * FROM music; id | band| album |date| asin|label

Re: [SQL] Display Length Between Var Varchar

2012-01-31 Thread Adrian Klaver
On Tuesday, January 31, 2012 8:08:06 pm Carlos Mennens wrote: I've noticed when I set a field to char, it takes up lots of space over varchar: iamunix=# SELECT * FROM music; id | band| album |date| asin|

Re: Fw: Re: [SQL] pg_dump not correctly saving schema with partitioned tables?

2012-01-31 Thread Tom Lane
chester c young chestercyo...@yahoo.com writes: here is a test case: [ slightly less messed-up test case for anyone who wants to duplicate this: ] create schema s1; create schema s2; create table s1.t1( c1 bigserial primary key, c2 text ); create table s2.t1( c1 bigserial