Re: [GENERAL] auto_explain FDW

2013-06-28 Thread David Greco
-Original Message- From: Albe Laurenz [mailto:laurenz.a...@wien.gv.at] Sent: Friday, June 28, 2013 4:05 AM To: David Greco; pgsql-general@postgresql.org Subject: RE: auto_explain FDW David Greco wrote: In my development environment, I am using the auto_explain module to help debug

[GENERAL] AFTER triggers and constraints

2013-06-28 Thread David Greco
Came across an interesting situation as part of our Oracle to PostgreSQL migration. In Oracle, it appears that immediate constraints are checked after the entire statement is run, including any AFTER ROW triggers. In Postgres, they are applied before the AFTER ROW triggers. In some of our AFTER

Re: [GENERAL] AFTER triggers and constraints

2013-06-28 Thread David Greco
From: Vick Khera [mailto:vi...@khera.org] Sent: Friday, June 28, 2013 9:35 AM To: David Greco Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] AFTER triggers and constraints On Fri, Jun 28, 2013 at 8:45 AM, David Greco david_gr...@harte-hanks.commailto:david_gr...@harte-hanks.com wrote

Re: [GENERAL] AFTER triggers and constraints

2013-06-28 Thread David Greco
-Original Message- From: Tom Lane [mailto:t...@sss.pgh.pa.us] Sent: Friday, June 28, 2013 10:10 AM To: David Greco Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] AFTER triggers and constraints David Greco david_gr...@harte-hanks.com writes: Since the trigger is defined as AFTER

[GENERAL] auto_explain FDW

2013-06-27 Thread David Greco
In my development environment, I am using the auto_explain module to help debug queries the developers complain about being slow. I am also using the oracle_fdw to perform queries against some oracle servers. These queries are generally very slow and the application allows them to be. The

Re: [GENERAL] Trouble with replication

2013-06-10 Thread David Greco
From: Michael Paquier [mailto:michael.paqu...@gmail.com] Sent: Thursday, June 06, 2013 7:01 PM To: David Greco Cc: John R Pierce; pgsql-general@postgresql.org Subject: Re: [GENERAL] Trouble with replication On Thu, Jun 6, 2013 at 9:19 PM, David Greco david_gr...@harte

Re: [GENERAL] Trouble with replication

2013-06-06 Thread David Greco
From: Michael Paquier [mailto:michael.paqu...@gmail.com] Sent: Wednesday, June 05, 2013 9:43 PM To: David Greco Cc: John R Pierce; pgsql-general@postgresql.org Subject: Re: [GENERAL] Trouble with replication On Thu, Jun 6, 2013 at 7:23 AM, David Greco david_gr...@harte-hanks.commailto:david_gr

Re: [GENERAL] Trouble with replication

2013-06-06 Thread David Greco
From: Michael Paquier [mailto:michael.paqu...@gmail.com] Sent: Wednesday, June 05, 2013 9:43 PM To: David Greco Cc: John R Pierce; pgsql-general@postgresql.org Subject: Re: [GENERAL] Trouble with replication On Thu, Jun 6, 2013 at 7:23 AM, David Greco david_gr...@harte

[GENERAL] Trouble with replication

2013-06-05 Thread David Greco
I've setup two 9.2.4 servers to serve as master-slave in a streaming replication scenario. I started with a fresh database on the master, setup the replication, then imported using pg_restore about 30GB of data. The master and slave are geographically separated, so replication of this amount

Re: [GENERAL] Trouble with replication

2013-06-05 Thread David Greco
From: pgsql-general-ow...@postgresql.org [pgsql-general-ow...@postgresql.org] on behalf of John R Pierce [pie...@hogranch.com] Sent: Wednesday, June 05, 2013 5:00 PM To: pgsql-general@postgresql.org Subject: Re: [GENERAL] Trouble with replication On 6/5/2013 1:39 PM, David Greco wrote: I’ve

[GENERAL] Streaming Replication 9.2

2013-04-11 Thread David Greco
I've setup streaming replication between two 9.2 servers, and have a few concerns/questions. I set it up with a very large wal_keep_segments, 17000, and do NOT ship the logs to the standby. When I failover to the slave, MUST the process for bringing back up the former master initially as a

Re: [GENERAL] UPDATE syntax

2012-11-30 Thread David Greco
Yeah that's good, but there are plenty of columns, was hoping to be able to use (table.*) syntax -Original Message- From: Albe Laurenz [mailto:laurenz.a...@wien.gv.at] Sent: Friday, November 30, 2012 3:47 AM To: David Greco; pgsql-general@postgresql.org Subject: RE: [GENERAL] UPDATE

Re: [GENERAL] UPDATE syntax

2012-11-30 Thread David Greco
David Greco wrote: [wants to use CTEs in an UPDATE] Yeah that's good, but there are plenty of columns, was hoping to be able to use (table.*) syntax Is this a problem or do you just want to type as little as possible? You have to specify them in the SET clause anyway. No problem, just

[GENERAL] UPDATE syntax

2012-11-29 Thread David Greco
Need some help with UPDATE syntax. I am attempting to do something like this: WITH default_facility AS ( SELECT facility_id, inkjetorlabel FROM engagement_facility_defs WHERE engagement_facility_def_id = 8 ) UPDATE

[GENERAL] plpgsql cursor reuse

2012-11-12 Thread David Greco
Came across this problem when trying to assign to a variable a field from a record that could come from multiple cursors. PG throws an error - ERROR: type of parameter 7 (bigint) does not match that when preparing the plan (unknown). If I make the null column in c1 null::bigint to match cursor

[GENERAL] Set Returning Functions and joins

2012-08-15 Thread David Greco
I'm porting some code from an Oracle application and we have many uses of set returning function. In particular, we are using them in joins of the form: CREATE TABLE dave ( id integer, field1 integer ); INSERT INTO dave VALUES (1, 10); SELECT id, g.* FROM dave

Re: [GENERAL] Set Returning Functions and joins

2012-08-15 Thread David Greco
a LEFT JOIN version of this query. From: David Johnston [mailto:pol...@yahoo.com] Sent: Wednesday, August 15, 2012 4:16 PM To: David Greco Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Set Returning Functions and joins On Aug 15, 2012, at 15:55, David Greco david_gr...@harte

Re: [GENERAL] Set Returning Functions and joins

2012-08-15 Thread David Greco
Awesome, thanks that works and is quite clear. The plan looks a bit funny on this. Any high-level synopsis on the performance of this? From: David Johnston [mailto:pol...@yahoo.com] Sent: Wednesday, August 15, 2012 4:57 PM To: David Greco Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL

[GENERAL] Feature Request - Postgres FDW

2012-08-07 Thread David Greco
Surprised to see this isn't offered as a Foreign Data Wrapper- one to other Postgres servers. I was attempting to replace some uses I have of dbilink, and found a couple places where I am using it to connect to Postgres. One is for pseudo Autonomous Transactions- a db link to the same postgres

Re: [GENERAL] Feature Request - Postgres FDW

2012-08-07 Thread David Greco
Great thanks. I see there is talk of 9.3 including autonomous transaction support as well. -Original Message- From: Kevin Grittner [mailto:kevin.gritt...@wicourts.gov] Sent: Tuesday, August 07, 2012 1:04 PM To: David Greco; pgsql-general@postgresql.org Subject: Re: [GENERAL] Feature

[GENERAL] Calling Functions With OUT paramaters

2012-02-29 Thread David Greco
I have a function definited as such: CREATE OR REPLACE FUNCTION address_pkg.parse_zip(IN cpostal character varying, OUT czip character varying, OUT czip4 character varying) LANGUAGE plpgsql; How does one call this from another plpgsql function? Currently, I am using something of the form:

[GENERAL] PLPGSQL SETOF functions

2011-06-28 Thread David Greco
I am porting some Oracle code to PLPGSQL and am having a problem with functions that return SETOF datatype. In Oracle, the functions I'm porting return a TABLE of TYPE datatype, this TABLE being itself a named type. I am not aware of how to do this in PLPGSQL. Consider a function with header: