[GENERAL] Partition check constraint is ignored if parameter is passed from SQL function

2017-09-26 Thread Lukasz Kaminski
Hello, When query is executed in function that has language set to "sql" then parameters passed to it are not considered as either externally supplied parameters or constants as far as partitioning goes. It will scan all partitions, despite parameters clearly limiting it to just one. Changing fun

Re: [GENERAL] Partition table data not found in pg_dump

2016-04-22 Thread Adrian Klaver
On 04/15/2016 11:35 PM, vinothcanwin wrote: Partition tables are empty in backup while using pg_dump to take backup, but those tables having data in database. Below is the command i am using to take backup. ./pg_dump -i -h localhost -p 5432 -U postgres -F c -b -v -f /tmp/dump.sql db_mydb Not

[GENERAL] Partition table data not found in pg_dump

2016-04-18 Thread vinothcanwin
Partition tables are empty in backup while using pg_dump to take backup, but those tables having data in database. Below is the command i am using to take backup. ./pg_dump -i -h localhost -p 5432 -U postgres -F c -b -v -f /tmp/dump.sql db_mydb -- View this message in context: http://postgr

[GENERAL] Partition

2016-03-19 Thread Leonardo M . Ramé
Hi, I have read and re-read the Partitioning chapter (http://www.postgresql.org/docs/9.1/static/ddl-partitioning.html), but I still don't see how to implement this use case: One table storing current data, let's call it the "master table", then one or more partitions with old data. For examp

Re: [GENERAL] Partition

2016-03-19 Thread Melvin Davidson
On Fri, Mar 18, 2016 at 7:08 AM, Sándor Daku wrote: > > On 18 March 2016 at 10:55, Leonardo M. Ramé wrote: > >> Hi, I have read and re-read the Partitioning chapter ( >> http://www.postgresql.org/docs/9.1/static/ddl-partitioning.html), but I >> still don't see how to implement this use case: >>

Re: [GENERAL] Partition

2016-03-19 Thread Adrian Klaver
On 03/18/2016 02:55 AM, Leonardo M. Ramé wrote: Hi, I have read and re-read the Partitioning chapter (http://www.postgresql.org/docs/9.1/static/ddl-partitioning.html), but I still don't see how to implement this use case: One table storing current data, let's call it the "master table", then one

Re: [GENERAL] Partition

2016-03-18 Thread Sándor Daku
On 18 March 2016 at 10:55, Leonardo M. Ramé wrote: > Hi, I have read and re-read the Partitioning chapter ( > http://www.postgresql.org/docs/9.1/static/ddl-partitioning.html), but I > still don't see how to implement this use case: > > One table storing current data, let's call it the "master tab

Re: [GENERAL] Partition Help

2015-04-30 Thread Melvin Davidson
Rick, I am glad I could help, but I am not quite sure you understand the purpose/use of the trigger to partition the table. The trigger merely decides which child should get the data, the "query" is not passed, only the data, To be more specific, if your appropriate child table were child_1000, t

Re: [GENERAL] Partition Help

2015-04-30 Thread akshunj
Melvin, thanks. Syntax was indeed the problem there. Any idea how to pass the original query to the child table? My insert has 113 parameters passed in, but based on the constraint violations I am seeing, it seems they are not making. I suspect that: VALUE (NEW.*) does not pass in the original quer

Re: [GENERAL] Partition Help

2015-04-30 Thread akshunj
Hi Jim, I'm not going the partitioning route because I want to, I'm just out of options at this point. As this table gets bigger, performance just gets worse over time. I wanted to try partitioning to see if it helps. Thanks for the tip, looking at the function again what you suggest makes perfec

Re: [GENERAL] Partition Help

2015-04-29 Thread Jim Nasby
On 4/29/15 10:05 AM, akshunj wrote: IF ('invoice' <= 'I-1') THEN INSERT INTO myschema.mywork VALUES (NEW.*) ELSE IF ('invoice' >= 'I-10001' AND <= 'I-2' That's going to fall apart with invoice I-10. If you're going to go this route, depend on how IF ELSIF operates and don't try to

Re: [GENERAL] Partition Help

2015-04-29 Thread Melvin Davidson
I think the problem is you need to specify NEW.invoice in all comparisons (don't quote the 'column')and always, Always, ALWAYS end each statement with a semicolon. IE: IF (NEW.invoice <= 'I-1') THEN INSERT INTO myschema.mywork VALUES (NEW.*) ELSE IF (NEW.invoice >= 'I-10001' AND NEW.invoice <=

[GENERAL] Partition Help

2015-04-29 Thread akshunj
Hi, I am trying to setup partitions and as a test, I was able to follow the example in the Postgres docs using the date as a condition. Now I am trying to partition on a column with the data type character varying. I want to partition based on an invoice ID consisting on letters and numbers like

Re: [GENERAL] [partition table] fetchall or fetchone function can not get the returning rows

2011-12-21 Thread John R Pierce
On 12/21/11 10:24 AM, Xiaoning Xu wrote: Since the serial primary key of my partition table is the FK of some other tables, I need to get the id after each insertion. My solution now is to select the max id from the parent table. I am wondering if there is any other alternatives to solve this p

[GENERAL] [partition table] fetchall or fetchone function can not get the returning rows

2011-12-21 Thread Xiaoning Xu
Hello, I have a problem concerning the partition table. When I store a record into one of the partition and use "RETURNING table_id" or "RETURNING *", I expect the same result when calling fetchall or fetchone function as not using partition. However, it simply returns nothing. Since the ser

Re: [GENERAL] [partition table] python fetchall or fetchone function can not get the returning rows

2011-12-21 Thread Misa Simic
olumn with taken value - then the same value use later in other tables as fk... Kind Regards, Misa Sent from my Windows Phone From: Xiaoning Xu Sent: 21 December 2011 22:31 To: pgsql-general@postgresql.org Subject: [GENERAL] [partition table] python fetchall or fetchone function can not get the

[GENERAL] [partition table] python fetchall or fetchone function can not get the returning rows

2011-12-21 Thread Xiaoning Xu
Hello, I have a problem concerning the partition table. When I store a record into one of the partition and use "RETURNING table_id" or "RETURNING *", I expect the same result when calling fetchall or fetchone function as not using partition. However, it simply returns nothing. Since the seria

[GENERAL] [partition table] fetchall or fetchone function can not get the returning rows

2011-12-21 Thread Xiaoning Xu
Hello, I have a problem concerning the partition table. When I store a record into one of the partition and use "RETURNING table_id" or "RETURNING *", I expect the same result when calling fetchall or fetchone function as not using partition. However, it simply returns nothing. Since the seria

Re: [GENERAL] Partition tables

2009-08-05 Thread Vick Khera
On Mon, Aug 3, 2009 at 10:51 AM, Michael Gould wrote: > The total size of our database with 5 years worth of data is about 3.4 gig. > In the business we are in, we open about 5-7 new locations each year and > close 2-3.  I was also thinking that if each partition was by location it > It seems to m

Re: [GENERAL] Partition tables

2009-08-03 Thread Wojtek
Michael Gould wrote: 2. can you come up with a pattern you can use to segment your data into smaller chunks (like weeks, months, ids) to create partitions reasonably big but not huge Yes, each location has their own specific location code. good! how many rows you will have per each l

Re: [GENERAL] Partition tables

2009-08-03 Thread Wojtek
Michael Gould wrote: I am considering whether or not to partition a few tables in our system. The guide lines I read said that this could help when the size of a table exceeds the amount of system memory. I'm wondering if this statement should be table or database. The way our system operates

[GENERAL] Partition tables

2009-08-03 Thread Michael Gould
I am considering whether or not to partition a few tables in our system. The guide lines I read said that this could help when the size of a table exceeds the amount of system memory. I'm wondering if this statement should be table or database. The way our system operates is that each individual

Re: [GENERAL] Partition Reindexing

2007-09-05 Thread Rodrigo De León
On 9/4/07, Nik <[EMAIL PROTECTED]> wrote: > This is on PostgreSQL 8.1.3 on Windows 2003 Advanced Server. Only 8.2 or newer has CREATE INDEX CONCURRENTLY. Maybe you could schedule a maintenance window for this. ---(end of broadcast)--- TIP 5: don't

[GENERAL] Partition Reindexing

2007-09-04 Thread Nik
What is the effect of reindexing a partition on the inherited table? For example I have a table 'test' with partitions 'test_01_07', 'test_02_07', 'test_03_07', 'test_04_07', corresponding to data from January 2007, February 2007, and so on. I noticed that when I run a reindex on 'test_02_07' (wit

Re: [GENERAL] Partition Table

2007-03-03 Thread Martin Gainty
diffuser, de le distribuer ou de le reproduire. - Original Message - From: "Joshua D. Drake" <[EMAIL PROTECTED]> To: "Martin Gainty" <[EMAIL PROTECTED]> Cc: Sent: Saturday, March 03, 2007 3:26 PM Subject: Re: [GENERAL] Partition Table > Martin Gainty wrot

Re: [GENERAL] Partition Table

2007-03-03 Thread Joshua D. Drake
Martin Gainty wrote: > Good Afternoon All- > I come from the other DBMS from California where extremely large datasets > could be partitioned into separate and distinct partition tables > Lets say for example I have Property Table which contains a tera worth of > data and to gain performnce in

[GENERAL] Partition Table

2007-03-03 Thread Martin Gainty
Good Afternoon All- I come from the other DBMS from California where extremely large datasets could be partitioned into separate and distinct partition tables Lets say for example I have Property Table which contains a tera worth of data and to gain performnce in the indexing I *could* partitio

Re: [GENERAL] partition insert question

2006-12-07 Thread Marc Evans
On Thu, 7 Dec 2006, Marc Evans wrote: Hello - I find myself trying to find a way to have the table name used with the insert command be generated on the fly in a rule. For example, consider the following: create table foobars ( id bigserial, created_at timestamp not null, name ); creat

[GENERAL] partition insert question

2006-12-07 Thread Marc Evans
Hello - I find myself trying to find a way to have the table name used with the insert command be generated on the fly in a rule. For example, consider the following: create table foobars ( id bigserial, created_at timestamp not null, name ); create table foobars_200612 ( check (crea

Re: [GENERAL] Partition Rule Updating While Running?

2006-07-07 Thread Martijn van Oosterhout
On Fri, Jul 07, 2006 at 04:39:53AM -0400, Gene wrote: > Sorry if this is a duplicat, someone suggested posting to general as well, > > I'm using PostgreSQL 8.1.4 in a Hibernate Application and I am > attempting to use partitioning via Inherited tables. At first I was > going to create a rule per s

[GENERAL] Partition Rule Updating While Running?

2006-07-07 Thread Gene
Sorry if this is a duplicat, someone suggested posting to general as well, I'm using PostgreSQL 8.1.4 in a Hibernate Application and I am attempting to use partitioning via Inherited tables. At first I was going to create a rule per sub-table based on a date range, but found out with multiple rul