Re: [GENERAL] WIP: CoC V3

2016-01-12 Thread Andy Chambers
Sorry. I just saw the reference to this in the related thread. On Jan 11, 2016 7:01 PM, "Andy Chambers" wrote: > Any reason not to just adopt the contributor covenant? > > http://contributor-covenant.org/ > tl;dr; > > * Removed #6 (Social Justice) > > Postgre

Re: [GENERAL] WIP: CoC V3

2016-01-11 Thread Andy Chambers
Any reason not to just adopt the contributor covenant? http://contributor-covenant.org/ tl;dr; * Removed #6 (Social Justice) PostgreSQL Global Development Group (PGDG) Code of Conduct (CoC): 1. The CoC is to provide community guidelines for creating and enforcing a safe, respectful, productive,

Re: [GENERAL] Unit tests and foreign key constraints

2015-05-21 Thread Andy Chambers
On Thu, May 21, 2015 at 1:34 PM, Martijn van Oosterhout wrote: > On Thu, May 21, 2015 at 12:39:01PM -0700, Andy Chambers wrote: > > Hey All, > > > > I've started trying to use foreign key constraints in my schema but it > > seems to make it more difficult to

[GENERAL] Unit tests and foreign key constraints

2015-05-21 Thread Andy Chambers
Hey All, I've started trying to use foreign key constraints in my schema but it seems to make it more difficult to write unit tests that touch the database because each test now requires more setup data to satisfy the foreign key constraint. (I know some say your unit tests shouldn't touch the DB

[GENERAL] Testing Views

2015-05-20 Thread Andy Chambers
Hello All, I have a problem for which a view seems like a nice solution. Basically we want to see all records in some table that are older than 5 days and haven't yet gone through further processing. This particular view is probably simple enough that it doesn't require unit tests but I wonder ho

Re: [GENERAL] Sequence moves forward when failover is triggerred

2012-07-10 Thread Andy Chambers
On Tue, Jul 10, 2012 at 6:48 PM, Tom Lane wrote: > Andy Chambers writes: > > When testing the failover procedure, we noticed that when the new master > > comes up, some sequences have moved forward (by between 30 and 40). I > see > > there's a "cache"

Re: [GENERAL] Do I need archive_mode = on for hot standby?

2012-07-10 Thread Andy Chambers
On Mon, Jul 2, 2012 at 3:33 AM, Janne H wrote: > Hi there. > > I'm planning on setting up a master database and multiple hot standby > slaves using streaming replication. > > If I use a large(*) value on > wal_keep_segments > do I really need archive_mode = on then? > > Any potential problems wit

[GENERAL] Sequence moves forward when failover is triggerred

2012-07-10 Thread Andy Chambers
he" option when creating the sequence but we're not using that. Is this to be expected? Thanks, Andy -- Andy Chambers Software Engineer (e) achamb...@mcna.net (t) 954-682-0573 CONFIDENTIALITY NOTICE: This electronic mail may contain information that is privileged, confidential, and/or

Re: [GENERAL] Weird "LIKE" behaviour

2012-07-06 Thread Andy Chambers
On Fri, Jul 6, 2012 at 4:26 PM, David Johnston wrote: >> -Original Message- >> From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general- >> ow...@postgresql.org] On Behalf Of Andy Chambers >> Sent: Friday, July 06, 2012 4:17 PM >> To: pgsql >

[GENERAL] Weird "LIKE" behaviour

2012-07-06 Thread Andy Chambers
oo ( foo text ); => select * from foo where foo like 'FOO%\' The second one fails to execute the query... => select * from dcm.providers where lname like 'FOO%\' ERROR: LIKE pattern must not end with escape character Our server is 9.1.4 and can reproduce this behaviour wi

[GENERAL] Cancel a pg_ctl stop

2012-07-05 Thread Andy Chambers
Is it possible to "cancel" a pg_ctl stop if some clients remain connected and there is no longer a need to stop the DB? -- Andy Chambers Software Engineer (e) achamb...@mcna.net (t) 954-682-0573 CONFIDENTIALITY NOTICE: This electronic mail may contain information that is

[GENERAL] Promotion of standby to master

2012-06-29 Thread Andy Chambers
d to do this, I ran into the "timeline 2 of the primary does not match recovery target timeline 1". I'm just trying to figure out if that's because the procedure I followed to promote the standby was wrong or because it's just not possible. Thanks, Andy -- Andy Chambers Sof

[GENERAL] Memory Overcommit

2012-06-07 Thread Andy Chambers
opy on write" semantics. Is this true? Does it matter for a server running just postgres? -- Andy Chambers Software Engineer (e) achamb...@mcna.net (t) 954-682-0573 -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] new rows based on existing rows

2012-05-02 Thread Andy Chambers
ing clause. Is there a way I can return a simple mapping between old oids and new oids as part of the statement that inserts the new ones? Cheers, Andy -- Andy Chambers Software Engineer (e) achamb...@mcna.net (t) 954-682-0573 CONFIDENTIALITY NOTICE: This electronic mail may contain informati

Re: [GENERAL] trigger when clause

2012-04-12 Thread Andy Chambers
On Tue, Apr 10, 2012 at 5:10 PM, Jeff Davis wrote: > On Tue, 2012-04-10 at 16:15 -0400, Andy Chambers wrote: > > > Does anyone know the time complexity of the algorithm used to handle > > triggers with a when clause? > > It's done with a linear scan of all triggers,

[GENERAL] trigger when clause

2012-04-10 Thread Andy Chambers
se. What if n is 10? What if n is 200? The when clause would just be comparing a text "predicate" column for equality. Cheers, Andy -- Andy Chambers Software Engineer (e) achamb...@mcna.net (t) 954-682-0573 CONFIDENTIALITY NOTICE: This electronic mail may contain information that is

[GENERAL] copy syntax

2012-04-04 Thread Andy Chambers
dcm_eob=> copy ar_data from '/tmp/ar-data.csv' with header true; ERROR: syntax error at or near "true" LINE 1: copy ar_data from '/tmp/ar-data.csv' with header true; I can't figure out what's wrong with the syntax above. Is something missing? --

Re: [GENERAL] pg-admin development snapshots

2012-03-20 Thread Andy Chambers
On Tue, Mar 20, 2012 at 4:53 PM, Guillaume Lelarge wrote: > Hi, > > On Tue, 2012-03-20 at 16:01 -0400, Andy Chambers wrote: > [...] >> The link[1] for the development snapshots of pg-admin as advertised >> here [2] seems to be broken.  Are these snapshots hosted somewhe

[GENERAL] pg-admin development snapshots

2012-03-20 Thread Andy Chambers
se the new scripting feature. [1]: http://www.pgadmin.org/snapshots [2]: http://www.pgadmin.org/download/snapshots.php -- Andy Chambers Software Engineer (e) achamb...@mcna.net (t) 954-682-0573 CONFIDENTIALITY NOTICE: This electronic mail may contain information that is privileged, confidenti

[GENERAL] dropping an index inside a transaction

2012-03-17 Thread Andy Chambers
ransaction so that the rest of the application can still benefit from the indices. Cheers, Andy -- Andy Chambers Software Engineer (e) achamb...@mcna.net -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mail

[GENERAL] CROSS JOIN performance

2012-02-21 Thread Andy Chambers
the 3rd version yields no performance gain. Are these three queries logically equivalent (well, at least the latter two since the first isn't valid SQL)? If so, does it make sense that the optimizer has difficulty with the second case. Cheers, Andy -- Andy Chambers -- Sent via pgsql-gener

[GENERAL] Create duplicate of existing operator

2012-02-16 Thread Andy Chambers
Hi, Is it possible to use CREATE OPERATOR to make "&&" behave like "and"? In general, for the built-in operators, is it possible to see their "CREATE OPERATOR" statements? Cheers, Andy -- Andy Chambers *Software Engineer * *MCNA Dental Plans* 200

Re: [GENERAL] Update takes longer than expected

2012-01-09 Thread Andy Chambers
On Mon, Jan 9, 2012 at 4:30 PM, Tom Lane wrote: Sorry. Forgot to hit "Reply to All" Aha. I think I'd gotten carried away with some of the settings in order to optimize for bulk loading. Reverting back to the default postgresql.conf gets me back to the sort of times you guys are seeing here.

[GENERAL] Update takes longer than expected

2012-01-09 Thread Andy Chambers
Hi, I have an update that takes longer than expected and wondered if there's an easy way to make it go faster. It's pretty simple:- create table session ( id serial primary key, data text); update session set data = 'ipsum lorem...' where id = 5; The "ipsum lorem.." stuff is an encrypt

[GENERAL] immutable functions

2011-11-29 Thread Andy Chambers
The documentation has this to say about immutable functions... > or otherwise use information not directly present in its argument list If the arguments are "row variables", does this allow access to the data in the row? For example, is it safe to make the following function definition immutable

Re: [GENERAL] Batching up data into groups of n rows

2011-09-26 Thread Andy Chambers
On Mon, Sep 26, 2011 at 4:22 PM, Marti Raudsepp wrote: > On Mon, Sep 26, 2011 at 18:59, Andy Chambers wrote: >> ...and I want to select the data from that table, adding a "group_id" >> column, and a "record_id" column.  The "group_id" would start at

[GENERAL] Batching up data into groups of n rows

2011-09-26 Thread Andy Chambers
Hi, I have a need to write a query that batches up rows of a table into groups of n records. I feel like this should be possible using the existing window functions but I can't figure out how to do it from the examples. So I have some table, let's say create table addresses ( line_1 text, l

[GENERAL] Array syntax in the copier

2011-08-26 Thread Andy Chambers
Hi All, What's the correct method of writing array columns using the bulk copier. It seems to support the curly braces notation but how do you escape special characters like ","? I tried using "\x2c" and that prevents the syntax error but I end up with what looks like the string \x2c in the data

[GENERAL] Cursors

2011-06-14 Thread Andy Chambers
Hi, What happens to cursors when new data is added to a table after you start iterating over its rows? For example, given the following loop... for rule in select tc.sid, tc.s, td.rule, td.returns from tcell tc inner join tcelldef td on (tc.p = td.p)

Re: [GENERAL] syntax for updating an aliased table

2011-05-27 Thread Andy Chambers
On Thu, May 26, 2011 at 1:40 PM, Rick Genter wrote: > > The UPDATE statement when multiple tables are involved always drives me nuts. > I think what you need to do is remove all of the "old." from the SET clause > and use "triple." in the WHERE clause instead of "old." - and remove the old > tab

[GENERAL] syntax for updating an aliased table

2011-05-26 Thread Andy Chambers
I'm confused about the correct syntax for updating an aliased table. I want to update triple from triple_updates where the data is different and tried to use the following update triple old set old.obln = new.obln, old.ointv = new.oint

[GENERAL] Cursor metadata

2011-04-13 Thread Andy Chambers
Hi All, Is there anywhere in the postgres catalog where one can access metadata about a held cursor. Type information in particular would be really useful. Cheers, Andy -- Andy Chambers -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

Re: [GENERAL] Howto use "COPY FROM" with the native API?

2011-04-11 Thread Andy Chambers
On Mon, 11 Apr 2011 11:21:16 -0400, Clemens Eisserer wrote: Hi, We are working on an university project for network traffic accounting. We use ulogd-2 to log netfilter packets, however it creates for each packet a seperate transaction and also doesn't use prepared statements, which results i

[GENERAL] Dynamic Assignment

2011-03-23 Thread Andy Chambers
l Obviously this particular code could be re-written as a simple assignment but I need the "esid" part to be dynamic. Is this possible? Cheers, Andy -- Andy Chambers -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Trigger Function return values

2011-03-22 Thread Andy Chambers
fired. -- Andy Chambers -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Enable/Disable Triggers

2011-03-15 Thread Andy Chambers
Hi All, Is it a big no-no to enable/disable triggers by manually setting pg_trigger.tgenabled to 'D'? -- Andy Chambers -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Schema version control

2011-02-10 Thread Andy Chambers
DDL and DML. When it's time for an upgrade, you run the dbsteward tool against two schema XML files, and it calculates what has changed and generates the appropriate DDL and DML to upgrade. This sounds pretty cool. Ours doesn't do that yet but that's next on my TODO list. -- And

[GENERAL] Table inheritance foreign key problem

2010-12-21 Thread Andy Chambers
er text); insert into guidebooks ('Barcelona', ) -- not a capital insert into guidebooks ('Edinburgh', ) -- a capital insert into guidebooks ('France', ) -- fail -- Andy Chambers -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To