Re: [GENERAL] log_destination = csvlog, line breaks interfere in analysis

2012-09-18 Thread Craig Ringer
On 09/18/2012 03:21 AM, Edson Richter wrote: 2012-09-17 14:25:33.150 BRT,thedb,thedb,15660,10.10.20.1:33485,5054d3ab.3d2c,1,SELECT,2012-09-15 16:14:51 BRT,10/204822,0,LOG,0,duração: 505.494 ms executar unnamed: select A, B from C join D on C.id = D.c_id And so on. Yick.

Re: [GENERAL] RFE: Column aliases in WHERE clauses

2012-09-18 Thread Craig Ringer
On 09/18/2012 07:32 AM, Tom Lane wrote: It's easier to understand why this is if you realize that SQL has a very clear model of a pipeline of query execution. I just wish they hadn't written it backwards! It'd be much less confusing were it formulated as something like: SELECT FROM thetable

Re: [GENERAL] State of the art for foreign keys to child tables?

2012-09-18 Thread Albe Laurenz
François Beausoleil wrote: What's the state of the art for foreign keys on child tables? My use case is this: CREATE TABLE parties(party_id serial primary key); CREATE TABLE positions( PRIMARY KEY(party_id) ) INHERITS(parties); CREATE TABLE organizations( PRIMARY KEY(party_id) )

Re: [GENERAL] log_destination = csvlog, line breaks interfere in analysis

2012-09-18 Thread Albe Laurenz
Craig Ringer wrote: On 09/18/2012 03:21 AM, Edson Richter wrote: 2012-09-17 14:25:33.150 BRT,thedb,thedb,15660,10.10.20.1:33485,5054d3ab.3d2c,1,SELECT,2012-09-15 16:14:51 BRT,10/204822,0,LOG,0,duração: 505.494 ms executar unnamed: select A, B from C join D on C.id =

Re: [GENERAL] foreign key from array element

2012-09-18 Thread Rafal Pietrak
On Mon, 2012-09-17 at 14:31 -0500, Merlin Moncure wrote: On Mon, Sep 17, 2012 at 7:24 AM, Rafal Pietrak ra...@zorro.isa-geek.com wrote: On Mon, 2012-09-17 at 19:58 +0800, Craig Ringer wrote: On 09/17/2012 04:46 PM, Rafal Pietrak wrote: [--] There was some quite recent

Re: [GENERAL] foreign key from array element

2012-09-18 Thread Albe Laurenz
Rafal Pietrak wrote: On Mon, 2012-09-17 at 14:31 -0500, Merlin Moncure wrote: On Mon, Sep 17, 2012 at 7:24 AM, Rafal Pietrak ra...@zorro.isa-geek.com wrote: On Mon, 2012-09-17 at 19:58 +0800, Craig Ringer wrote: On 09/17/2012 04:46 PM, Rafal Pietrak wrote: [--] There

Re: [GENERAL] Index creation takes more time?

2012-09-18 Thread Herouth Maoz
I think you hit the nail right on the head when you asked: I wonder if they have different encoding/collations. [headdesk]Of course. One of the requirements of the upgrade was to change the database encoding to unicode, because previously it was in an 8-bit encoding and we couldn't handle

Re: [GENERAL] RFE: Column aliases in WHERE clauses

2012-09-18 Thread Rafal Pietrak
On Mon, 2012-09-17 at 16:44 -0700, Mike Christensen wrote: On Mon, Sep 17, 2012 at 4:32 PM, Tom Lane t...@sss.pgh.pa.us wrote: Mike Christensen m...@kitchenpc.com writes: [---] It's easier to understand why this is if you realize that SQL has a very clear model of a pipeline of

[GENERAL] Data recovery after inadvertent update?

2012-09-18 Thread Craig Ringer
Hi all Someone on SO has UPDATEd away some data they cared about. I've written a bit on what they might want to do, but really don't know enough, so I was hoping for some aid/ideas. In particular, is the advice to use pg_ctl stop -m immediate (to hopefully avoid a checkpoint) appropriate

Re: [GENERAL] foreign key from array element

2012-09-18 Thread Chris Travers
On Tue, Sep 18, 2012 at 12:37 AM, Albe Laurenz laurenz.a...@wien.gv.atwrote: You :^) The list of patches for the commitfest is here: https://commitfest.postgresql.org/action/commitfest_view?id=15 There is no reviewer for Array ELEMENT Foreign Keys yet. Silly question perhaps better

Re: [GENERAL] Data recovery after inadvertent update?

2012-09-18 Thread Виктор Егоров
Check this post on depesz.com: http://www.depesz.com/2012/04/04/lets-talk-dirty/ 2012/9/18 Craig Ringer ring...@ringerc.id.au Also, are there any functions to read raw tuple bytes to `RECORD's? I couldn't find any in `pageinspect', `pgstattuple', `adminpack', etc. Am I right in guessing that

[GENERAL] Move table - New schema

2012-09-18 Thread António Rodrigues
Hi list, (newbie question) I'm trying to move a set of tables between schemas. Tried: ALTER TABLE tablename SET SCHEMA schemaname It gives me error: schema schemaname does not exist (it does) Any help please. Thanks, António

Re: [GENERAL] foreign key from array element

2012-09-18 Thread Rafal Pietrak
On Tue, 2012-09-18 at 09:37 +0200, Albe Laurenz wrote: Rafal Pietrak wrote: [--] Who can review that patch? You :^) ;7 OK. (still smiling a little) [---] Here is information about what is required: http://wiki.postgresql.org/wiki/Reviewing_a_Patch I

Re: [GENERAL] log_destination = csvlog, line breaks interfere in analysis

2012-09-18 Thread Edson Richter
Em 18/09/2012 04:13, Albe Laurenz escreveu: Craig Ringer wrote: On 09/18/2012 03:21 AM, Edson Richter wrote: 2012-09-17 14:25:33.150 BRT,thedb,thedb,15660,10.10.20.1:33485,5054d3ab.3d2c,1,SELECT,2012-09-15 16:14:51 BRT,10/204822,0,LOG,0,duração: 505.494 ms executar unnamed: select A, B

Re: [GENERAL] foreign key from array element

2012-09-18 Thread Gabriele Bartolini
Hi Rafal, Il 18/09/12 13:00, Rafal Pietrak ha scritto: I did have a look, and feel slightly encouraged reading: Many people feel that they're not qualified; yes, that's me all right. Serously, I will try to do by best ... by the weekend, when I get some spare time. It is such a coincidence

Re: [GENERAL] Move table - New schema

2012-09-18 Thread Adrian Klaver
On 09/18/2012 03:48 AM, António Rodrigues wrote: Hi list, (newbie question) I'm trying to move a set of tables between schemas. Tried: ALTER TABLE tablename SET SCHEMA schemaname It gives me error: schema schemaname does not exist (it does)

Re: [GENERAL] Index creation takes more time?

2012-09-18 Thread Tom Lane
Herouth Maoz hero...@unicell.co.il writes: So, I must, at this point, draw the conclusion that string comparison is a much, much heavier task in utf-8 than it is in an 8-bit encoding - or that the collation is the problem. Going from C collation to anything else is generally a huge hit in

Re: [GENERAL] Move table - New schema

2012-09-18 Thread António Rodrigues
You were both right. It was a problem with permissions. Thank you, António On Tue, Sep 18, 2012 at 2:37 PM, Adrian Klaver adrian.kla...@gmail.comwrote: On 09/18/2012 03:48 AM, António Rodrigues wrote: Hi list, (newbie question) I'm trying to move a set of tables between schemas. Tried:

Re: [GENERAL] RFE: Column aliases in WHERE clauses

2012-09-18 Thread Chris Angelico
On Tue, Sep 18, 2012 at 4:44 PM, Craig Ringer ring...@ringerc.id.au wrote: On 09/18/2012 07:32 AM, Tom Lane wrote: It's easier to understand why this is if you realize that SQL has a very clear model of a pipeline of query execution. I just wish they hadn't written it backwards! It'd be

[GENERAL] Column aliases in WHERE clauses

2012-09-18 Thread Eden Cardim
Craig == Craig Ringer ring...@ringerc.id.au writes: Craig I just wish they hadn't written it backwards! Craig It'd be much less confusing were it formulated as something Craig like: Craig SELECT FROM thetable WHERE first_letter 'a' RESULTS Craig left(value,1) AS

Re: [GENERAL] How to access the extension's operator installed with schema ?

2012-09-18 Thread xoip
Thank you for the quick answer, problem solved. -- View this message in context: http://postgresql.1045698.n5.nabble.com/How-to-access-the-extension-s-operator-installed-with-schema-tp5724032p5724437.html Sent from the PostgreSQL - general mailing list archive at Nabble.com. -- Sent via

Re: [GENERAL] Column aliases in WHERE clauses

2012-09-18 Thread Mike Christensen
On Tue, Sep 18, 2012 at 2:53 AM, Eden Cardim e...@insoli.de wrote: Craig == Craig Ringer ring...@ringerc.id.au writes: Craig I just wish they hadn't written it backwards! Craig It'd be much less confusing were it formulated as something Craig like: Craig SELECT FROM

Re: [GENERAL] On Ubuntu 12.04 i do have two psql one of those isn't working

2012-09-18 Thread Raymond O'Donnell
On 18/09/2012 16:10, Yvon Thoraval wrote: I've found the prob. In my postgresql.conf file the default port is setup to 5433 instead of 5432 as previously... OK - you probably had two versions of PG installed at some point - when you install a second version of PG alongside an existing one on

[GENERAL] Time-based trigger

2012-09-18 Thread Robert Sosinski
We have a table, which has items that can be put on hold of 5 minutes (this is for an online store) once they are placed into a cart. What we need is for this hold to automatically expire after 5 minutes. Right now, we put a time stamp into the row (called hold_until) at 5 minutes into the

Re: [GENERAL] Time-based trigger

2012-09-18 Thread Szymon Guz
On 18 September 2012 17:59, Robert Sosinski rsosin...@ticketevolution.comwrote: We have a table, which has items that can be put on hold of 5 minutes (this is for an online store) once they are placed into a cart. What we need is for this hold to automatically expire after 5 minutes. Right

Re: [GENERAL] On Ubuntu 12.04 i do have two psql one of those isn't working

2012-09-18 Thread Yvon Thoraval
2012/9/18 Raymond O'Donnell r...@iol.ie On 18/09/2012 16:10, Yvon Thoraval wrote: I've found the prob. In my postgresql.conf file the default port is setup to 5433 instead of 5432 as previously... OK - you probably had two versions of PG installed at some point - when you install a

Re: [GENERAL] On Ubuntu 12.04 i do have two psql one of those isn't working

2012-09-18 Thread Yvon Thoraval
I've found the prob. In my postgresql.conf file the default port is setup to 5433 instead of 5432 as previously... sorry for the noise.

Re: [GENERAL] Time-based trigger

2012-09-18 Thread Rob Sargent
On 09/18/2012 10:03 AM, Szymon Guz wrote: On 18 September 2012 17:59, Robert Sosinski rsosin...@ticketevolution.com mailto:rsosin...@ticketevolution.com wrote: We have a table, which has items that can be put on hold of 5 minutes (this is for an online store) once they are placed into a

Re: [GENERAL] Index creation takes more time?

2012-09-18 Thread Jeff Janes
On Tue, Sep 18, 2012 at 1:13 AM, Herouth Maoz hero...@unicell.co.il wrote: I think you hit the nail right on the head when you asked: I wonder if they have different encoding/collations. [headdesk]Of course. One of the requirements of the upgrade was to change the database encoding to

Re: [GENERAL] Slow counting still true?

2012-09-18 Thread Jeff Janes
On Mon, Sep 17, 2012 at 9:14 AM, Edson Richter edsonrich...@hotmail.com wrote: The wiki page in question has been updated today, and I see the alert in top of page Note that the following article only applies to versions of PostgreSQL prior to 9.2. Index-only scans are now implemented. So

Re: [GENERAL] Column aliases in WHERE clauses

2012-09-18 Thread Mike Christensen
On Tue, Sep 18, 2012 at 11:20 AM, Eden Cardim e...@insoli.de wrote: Mike == Mike Christensen m...@kitchenpc.com writes: Mike I can also say if the table came before the columns, we'd Mike probably have a lot more SQL editors with auto-complete that Mike worked :) There's nothing

Re: [GENERAL] foreign key from array element

2012-09-18 Thread Rafal Pietrak
Hi, On Tue, 2012-09-18 at 15:12 +0200, Gabriele Bartolini wrote: Hi Rafal, [] It is such a coincidence that yesterday I had started to write this article (http://blog.2ndquadrant.com/postgresql-9-3-development-array-element-foreign-keys/) about this feature for 9.3 and

Re: [GENERAL] Time-based trigger

2012-09-18 Thread Steve Crawford
On 09/18/2012 08:59 AM, Robert Sosinski wrote: We have a table, which has items that can be put on hold of 5 minutes (this is for an online store) once they are placed into a cart. What we need is for this hold to automatically expire after 5 minutes. Right now, we put a time stamp into the

Re: [GENERAL] Column aliases in WHERE clauses

2012-09-18 Thread Eden Cardim
Mike == Mike Christensen m...@kitchenpc.com writes: Mike I can also say if the table came before the columns, we'd Mike probably have a lot more SQL editors with auto-complete that Mike worked :) There's nothing stopping an editor from making you type the table first though, it's

Re: [GENERAL] foreign key from array element

2012-09-18 Thread Kevin Grittner
Rafal Pietrak ra...@zorro.isa-geek.com wrote: where do I get current-v9.3 from? At this point 9.3 just means the HEAD of the master branch of the git repository, which is where development for the next major release of software is always done. For details of the public git repository see:

Re: [GENERAL] checkpoint_timeout and archive_timeout

2012-09-18 Thread Jeff Janes
On Tue, Sep 11, 2012 at 5:36 AM, Kevin Grittner kevin.gritt...@wicourts.gov wrote: Jeff Janes wrote: Kevin Grittner wrote: BTW, that's also why I wrote the pg_clearxlogtail utility (source code on pgfoundry). We pipe our archives through that and gzip which changes this to an endless

[GENERAL] Double types

2012-09-18 Thread Hall, Samuel L (Sam)
I have an application that writes an Excel Spreadsheet to postgres. For the values that go in number fields, I check the Excel values for dbnull and set the parameters to 0, like this: cmd.Parameters(9).Value = 0. Npgsql throws an error format specifier was invalid If I do this:

Re: [GENERAL] foreign key from array element

2012-09-18 Thread Rafal Pietrak
On Tue, 2012-09-18 at 15:38 -0500, Kevin Grittner wrote: Rafal Pietrak ra...@zorro.isa-geek.com wrote: where do I get current-v9.3 from? At this point 9.3 just means the HEAD of the master branch of the git repository, which is where development for the next major release of software is

Re: [GENERAL] checkpoint_timeout and archive_timeout

2012-09-18 Thread Kevin Grittner
Jeff Janes jeff.ja...@gmail.com wrote: Kevin Grittner kevin.gritt...@wicourts.gov wrote: We pipe the file into pg_clearxlogtail | gzip and pipe it out to the archive directory (with a .gz suffix), rather than using cp and processing it later. Well, actually, we pipe it to a directory on

Re: [GENERAL] Double types

2012-09-18 Thread Chris Angelico
On Wed, Sep 19, 2012 at 7:25 AM, Hall, Samuel L (Sam) sam.h...@alcatel-lucent.com wrote: I have an application that writes an Excel Spreadsheet to postgres. For the values that go in number fields, I check the Excel values for dbnull and set the parameters to 0, like this:

Re: [GENERAL] foreign key from array element

2012-09-18 Thread Tom Lane
Rafal Pietrak ra...@zorro.isa-geek.com writes: postmaster/postmaster.o: In function `PostmasterMain':^M postmaster.c:(.text+0x4bc8): undefined reference to `optreset'^M tcop/postgres.o: In function `process_postgres_switches':^M postgres.c:(.text+0x1422): undefined reference to `optreset'^M

[GENERAL] Change key primary for key foreign

2012-09-18 Thread Guilherme Rodrigues
Hello. I want to change one table already created. Where the comand? thank you. -- 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] Change key primary for key foreign

2012-09-18 Thread Raymond O'Donnell
On 18/09/2012 21:37, Guilherme Rodrigues wrote: Hello. I want to change one table already created. Where the comand? thank you. ALTER TABLE http://www.postgresql.org/docs/9.2/static/sql-altertable.html What exactly do you want to do? Ray. -- Raymond O'Donnell :: Galway :: Ireland

Re: [GENERAL] foreign key from array element

2012-09-18 Thread Chris Travers
On Tue, Sep 18, 2012 at 6:12 AM, Gabriele Bartolini gabriele.bartol...@2ndquadrant.it wrote: Hi Rafal, Il 18/09/12 13:00, Rafal Pietrak ha scritto: I did have a look, and feel slightly encouraged reading: Many people feel that they're not qualified; yes, that's me all right. Serously, I

[GENERAL] Difference between ON and WHERE in JOINs

2012-09-18 Thread Jean-Christophe Boggio
I'm looking for an article that explains the difference between these constructs IN POSTGRESQL (the rules seem to differ from one DB to another) : SELECT A.* FROM A JOIN B ON a.id=b.id AND A.somefield='somevalue' and SELECT A.* FROM A JOIN B ON a.id=b.id WHERE A.somefield='somevalue' I have

Re: [GENERAL] Difference between ON and WHERE in JOINs

2012-09-18 Thread David Johnston
On Sep 18, 2012, at 20:21, Jean-Christophe Boggio postgre...@thefreecat.org wrote: I'm looking for an article that explains the difference between these constructs IN POSTGRESQL (the rules seem to differ from one DB to another) : SELECT A.* FROM A JOIN B ON a.id=b.id AND

Re: [GENERAL] Column aliases in WHERE clauses

2012-09-18 Thread Eden Cardim
Mike == Mike Christensen m...@kitchenpc.com writes: Mike No, I meant editors that auto-complete SQL statements for Mike you as you're typing them. Like Intellisense in Visual Mike Studio. Mike Obviously you wouldn't want to type select and then see a Mike list of every

Re: [GENERAL] Change key primary for key foreign

2012-09-18 Thread Guilherme Rodrigues
I created one table so: CREATE TABLE clima ( city char(80), cprc int, ); And have other table so: CREATE TABLE city ( namechar(80), other_thing int, ); But now I want the table clima receive name table city as foreign key. understand? Sorry my bad

Re: [GENERAL] Column aliases in WHERE clauses

2012-09-18 Thread Chris Travers
On Tue, Sep 18, 2012 at 2:53 AM, Eden Cardim e...@insoli.de wrote: Craig == Craig Ringer ring...@ringerc.id.au writes: Craig I just wish they hadn't written it backwards! Craig It'd be much less confusing were it formulated as something Craig like: Craig SELECT FROM

Re: [GENERAL] Change key primary for key foreign

2012-09-18 Thread Edson Richter
Em 18/09/2012 21:25, Guilherme Rodrigues escreveu: I created one table so: CREATE TABLE clima ( city char(80), cprc int, ); And have other table so: CREATE TABLE city ( namechar(80), other_thing int, ); But now I want the table clima receive name