Re: [HACKERS] using arrays within structure in ECPG

2014-03-24 Thread Ashutosh Bapat
On Mon, Mar 24, 2014 at 3:40 PM, Boszormenyi Zoltan wrote: > 2014-03-24 07:22 keltezéssel, Ashutosh Bapat írta: > > Hi, > I tried using integer array within a structure array in ECPG code. But > it resulted in some garbage values being printed from the table. Here are > the details, > > The E

Re: [HACKERS] About adding an attribute to pg_attibute

2014-03-24 Thread Craig Ringer
On 03/25/2014 01:44 AM, Tanmay Deshpande wrote: > We are trying add columnar support to postgreSQL and for that we need > identify each column in each relation by an oid. So my doubt is how do > we add an attribute/ a column to catalog pg_attribute ? Is this some kind of class project? I've seen

[HACKERS] Why MarkBufferDirtyHint doesn't increment shared_blks_dirtied

2014-03-24 Thread Amit Kapila
MarkBufferDirty() always increment BufferUsage counter (shared_blks_dirtied) for dirty blocks whenever it dirties any block, whereas same is not true for MarkBufferDirtyHint(). Is there any particular reason for not incrementing shared_blks_dirtied in MarkBufferDirtyHint()? With Regards, Amit Ka

Re: [HACKERS] Global flag

2014-03-24 Thread Craig Ringer
On 03/24/2014 05:53 PM, Swapnil Bhoite wrote: > Hi, > > I want to set a *global flag* with which I can decide whether to use my > code or not > in modified source code. > How I can do that? Please reply to existing mailing list threads. Don't make a new message for every post. It's confusing and

Re: [HACKERS] psql blows up on BOM character sequence

2014-03-24 Thread Craig Ringer
On 03/25/2014 07:05 AM, Tom Lane wrote: > Jim Nasby writes: >> Wait... I thought that was one of the objections... that we wanted to >> leave a BOM in something like a COPY untouched? > > I think most of us are okay with stripping a BOM that appears at the > *beginning* of a text file (assuming t

Re: [HACKERS] psql blows up on BOM character sequence

2014-03-24 Thread Craig Ringer
On 03/25/2014 02:50 AM, Jim Nasby wrote: > So instead of trying to handle this on the psql side[1], I think we need > to handle it in the backend; specifically in the parser. Is there an > easy way to get the parser to ignore the BOM character in the context of > commands (but not in strings)? I d

Re: [HACKERS] [bug fix] PostgreSQL fails to start on Windows if it crashes after tablespace creation

2014-03-24 Thread Amit Kapila
On Mon, Mar 24, 2014 at 7:49 PM, MauMau wrote: > A bit contrived example is: > > 1. After the directory is created by TablespaceCreateDbspace(), recovery is > stopped (e.g. due to power outage). The directory remains. > 2. Restart the server, redoing CREATE TABLESPACE during recovery, which > exe

Re: [HACKERS] About adding a column to an existing system catalog

2014-03-24 Thread Tom Lane
Tanmay Deshpande writes: > while adding a column to an existing system catalog I am getting following > error while initdb > FATAL: incorrect number of columns in row (expected 22, got 21) > where do I have to make the changes ? I'd say you missed updating relnatts in the hard-coded row for pg

Re: [HACKERS] Dynamic background workers & docs question

2014-03-24 Thread Michael Paquier
On Mon, Mar 24, 2014 at 11:03 PM, Magnus Hagander wrote: > That's what I thought. Can a dynamic background worker start *another* > dynamic background worker, or can they only be started from "first level" > background workers? I have never really tried by myself, but I don't see any reason why it

[HACKERS] About adding a column to an existing system catalog

2014-03-24 Thread Tanmay Deshpande
while adding a column to an existing system catalog I am getting following error while initdb FATAL: incorrect number of columns in row (expected 22, got 21) where do I have to make the changes ?

Re: [HACKERS] psql blows up on BOM character sequence

2014-03-24 Thread Andrew Dunstan
On 03/24/2014 08:28 PM, Tatsuo Ishii wrote: The code would probably be pretty trivial, *if* we had consensus on what the behavior ought to be. I'm not sure if we do. People who only use Unicode would probably like it if BOMs were unconditionally swallowed, whether or not psql thinks the client

[HACKERS] About adding an attribute to a system catalog

2014-03-24 Thread Tanmay Deshpande
My doubt is what changes does one have to make in the source code if he/she is trying to add an attribute to the existing system catalogs table ?

Re: [HACKERS] Useless "Replica Identity: NOTHING" noise from psql \d

2014-03-24 Thread Bruce Momjian
On Mon, Mar 24, 2014 at 01:35:20PM -0300, Alvaro Herrera wrote: > Bruce Momjian wrote: > > On Mon, Mar 24, 2014 at 05:06:25PM +0100, Andres Freund wrote: > > > On 2014-03-22 23:47:57 -0400, Bruce Momjian wrote: > > > > test=> \d+ test > > > > Table "public.t

Re: [HACKERS] psql blows up on BOM character sequence

2014-03-24 Thread Tatsuo Ishii
> The code would probably be pretty trivial, *if* we had consensus on > what the behavior ought to be. I'm not sure if we do. People who > only use Unicode would probably like it if BOMs were unconditionally > swallowed, whether or not psql thinks the client_encoding is UTF8. > (And I seem to rec

Re: [HACKERS] About adding an attribute to pg_attibute

2014-03-24 Thread Michael Paquier
On Tue, Mar 25, 2014 at 2:44 AM, Tanmay Deshpande wrote: > We are trying add columnar support to postgreSQL and for that we need > identify each column in each relation by an oid. So my doubt is how do we > add an attribute/ a column to catalog pg_attribute ? You can identify already uniquely colu

Re: [HACKERS] psql blows up on BOM character sequence

2014-03-24 Thread Tatsuo Ishii
>> Just a quick comment on this. Yes, pgAdmin always added a BOM in every >> SQL files it wrote. > > From > http://stackoverflow.com/questions/2223882/whats-different-between-utf-8-and-utf-8-without-bom: > > According to the Unicode standard, the BOM for UTF-8 files is not recommended: > > 2.6

Re: [HACKERS] Only first XLogRecData is visible to rm_desc with WAL_DEBUG

2014-03-24 Thread Alvaro Herrera
Robert Haas wrote: > On Mon, Mar 24, 2014 at 7:14 AM, Tom Lane wrote: > >> 3. Remove the feature altogether, so that enabling wal_debug doesn't > >> cause all insertions to be logged anymore (no changes to the logging > >> during replay). It's a lot less interesting now that we have pg_xlogdump.

Re: [HACKERS] GSoC application: MADlib k-medoids clustering

2014-03-24 Thread Robert Haas
On Thu, Mar 20, 2014 at 12:30 PM, Maxence Ahlouche wrote: > My proposal is now available on Google melange website: > http://www.google-melange.com/gsoc/proposal/public/google/gsoc2014/viod/5668600916475904 > There seems to be a formatting issue: half of the text is a link to the page > I mentionn

Re: [HACKERS] Only first XLogRecData is visible to rm_desc with WAL_DEBUG

2014-03-24 Thread Robert Haas
On Mon, Mar 24, 2014 at 7:14 AM, Tom Lane wrote: > Heikki Linnakangas writes: >> As we all know, when you compile with WAL_DEBUG, and enable wal_debug >> GUC, you get output like this in the log for every inserted WAL record: > >> LOG: INSERT @ 0/5407E578: prev 0/5407E4D0; xid 0; len 32: Standby

Re: [HACKERS] psql blows up on BOM character sequence

2014-03-24 Thread Tom Lane
Jim Nasby writes: > Wait... I thought that was one of the objections... that we wanted to > leave a BOM in something like a COPY untouched? I think most of us are okay with stripping a BOM that appears at the *beginning* of a text file (assuming there's reason to believe the file is in UTF8 encod

Re: [HACKERS] psql blows up on BOM character sequence

2014-03-24 Thread Jim Nasby
On 3/24/14, 1:59 PM, Andrew Dunstan wrote: It occurs to me that we're going about this the wrong way... The error here isn't being generated by psql; it's generated by the backend. In the context of a statement (and not, say, a COPY command). So instead of trying to handle this on the psql sid

Re: [pgsql-advocacy] [HACKERS] First draft of update announcement

2014-03-24 Thread Josh Berkus
On 03/19/2014 02:16 PM, Darren Duncan wrote: > On 2014-03-18, 2:42 PM, Josh Berkus wrote: >> Other PostgreSQL 9.3 only fixes in this update include: >> >> * Add read-only data_checksum parameter > > I recall being told last fall that this would not be added to 9.3.x > (9.3.1 at the time I think) a

Re: [HACKERS] psql blows up on BOM character sequence

2014-03-24 Thread Merlin Moncure
On Mon, Mar 24, 2014 at 2:37 PM, Merlin Moncure wrote: > psql -1 already requires '-f' to work actually, it doesn't. this was fixed recently. merlin -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/

Re: [HACKERS] psql blows up on BOM character sequence

2014-03-24 Thread Merlin Moncure
On Mon, Mar 24, 2014 at 2:16 PM, Tom Lane wrote: > Andrew Dunstan writes: >> I suspect suspect trying to do this in the parser will be quite messy. >> This needs to happen before the input is converted to the server >> encoding, I think. > > Indeed --- what if the server isn't using utf8 internal

Re: [HACKERS] psql blows up on BOM character sequence

2014-03-24 Thread Tom Lane
Andrew Dunstan writes: > I suspect suspect trying to do this in the parser will be quite messy. > This needs to happen before the input is converted to the server > encoding, I think. Indeed --- what if the server isn't using utf8 internally? And a larger point is that the server has no idea w

Re: [HACKERS] psql blows up on BOM character sequence

2014-03-24 Thread Andrew Dunstan
On 03/24/2014 02:50 PM, Jim Nasby wrote: On 3/22/14, 11:26 AM, Jim Nasby wrote: On 3/21/14, 4:54 PM, Tom Lane wrote: Merlin Moncure writes: There is no way for psql to handle that case though unless you'd strip *all* BOMs encountered. Compounding this problem is that there's no practical wa

Re: [HACKERS] psql blows up on BOM character sequence

2014-03-24 Thread Jim Nasby
On 3/22/14, 11:26 AM, Jim Nasby wrote: On 3/21/14, 4:54 PM, Tom Lane wrote: Merlin Moncure writes: There is no way for psql to handle that case though unless you'd strip *all* BOMs encountered. Compounding this problem is that there's no practical way AFAIK to send multiple file to psql via s

Re: [HACKERS] Global flag

2014-03-24 Thread Jeff Janes
On Mon, Mar 24, 2014 at 2:53 AM, Swapnil Bhoite wrote: > Hi, > > I want to set a *global flag* with which I can decide whether to use my > code or not > in modified source code. > How I can do that? > edit src/backend/utils/misc/guc.c to add an external variable declaration near "XXX these should

[HACKERS] About adding an attribute to pg_attibute

2014-03-24 Thread Tanmay Deshpande
We are trying add columnar support to postgreSQL and for that we need identify each column in each relation by an oid. So my doubt is how do we add an attribute/ a column to catalog pg_attribute ?

Re: [HACKERS] HEAD seems to generate larger WAL regarding GIN index

2014-03-24 Thread Heikki Linnakangas
I came up with the attached patch, to reduce the WAL volume of GIN insertions. It become fairly large, but I guess that's not too surprising as the old WAL-logging method was basically to dump the whole page to WAL record. This is now a lot more fine-grained and smarter. I separated constructin

Re: [HACKERS] Useless "Replica Identity: NOTHING" noise from psql \d

2014-03-24 Thread Alvaro Herrera
Bruce Momjian wrote: > On Mon, Mar 24, 2014 at 05:06:25PM +0100, Andres Freund wrote: > > On 2014-03-22 23:47:57 -0400, Bruce Momjian wrote: > > > test=> \d+ test > > >Table "public.test" > > >Column | Type | Modifiers | Storage | Stats target | Description > >

Re: [HACKERS] Useless "Replica Identity: NOTHING" noise from psql \d

2014-03-24 Thread Bruce Momjian
On Mon, Mar 24, 2014 at 05:06:25PM +0100, Andres Freund wrote: > On 2014-03-22 23:47:57 -0400, Bruce Momjian wrote: > > test=> \d+ test > > Table "public.test" > > Column | Type | Modifiers | Storage | Stats target | Description > > +-+--

Re: [HACKERS] Useless "Replica Identity: NOTHING" noise from psql \d

2014-03-24 Thread Andres Freund
On 2014-03-22 23:47:57 -0400, Bruce Momjian wrote: > test=> \d+ test >Table "public.test" >Column | Type | Modifiers | Storage | Stats target | Description > +-+---+-+--+- >x

Re: [HACKERS] Useless "Replica Identity: NOTHING" noise from psql \d

2014-03-24 Thread Bruce Momjian
On Sun, Mar 23, 2014 at 11:49:37AM -0400, Tom Lane wrote: > Bruce Momjian writes: > > Is this the patch you had in mind? I kept the pg_catalog filter. Do we > > want to always show the replica identity line for \d+? > > Doesn't seem like a great idea to remove the filter tests for replident > v

Re: [HACKERS] [bug fix] PostgreSQL fails to start on Windows if it crashes after tablespace creation

2014-03-24 Thread MauMau
From: "Amit Kapila" 1. Assume a tablespace tbs already exists. 2. Create table t1(c1 int) tablespace tbs; 3. drop table t1; 4. Drop tablespace tbs; 5. Do immediate shutdown (pg_ctl stop -mi); 6. During recovery it will create a table in directory (in function TablespaceCreateDbspace) which ne

Re: [HACKERS] Only first XLogRecData is visible to rm_desc with WAL_DEBUG

2014-03-24 Thread Tom Lane
Heikki Linnakangas writes: > As we all know, when you compile with WAL_DEBUG, and enable wal_debug > GUC, you get output like this in the log for every inserted WAL record: > LOG: INSERT @ 0/5407E578: prev 0/5407E4D0; xid 0; len 32: Standby - > running xacts: nextXid 774 latestCompletedXid 771

Re: [HACKERS] Dynamic background workers & docs question

2014-03-24 Thread Magnus Hagander
On Mon, Mar 24, 2014 at 12:20 PM, Michael Paquier wrote: > On Mon, Mar 24, 2014 at 5:54 PM, Magnus Hagander > wrote: > > I was looking at > http://www.postgresql.org/docs/devel/static/bgworker.html > > with a client today. > > > > It says: > > "Unlike RegisterBackgroundWorker, which can only be

Re: [HACKERS] Command line argument for Server

2014-03-24 Thread Tom Lane
Swapnil Bhoite writes: > I want to set or reset a global flag. > 1) What currently I'm thinking is, I'll declare that global flag in > *postgres.h* > 2) I'll set that depending on my custom flag given at server startup > 3) I encountered function *getopt* but I couldn't understand it > So my ques

[HACKERS] New Vacancy for Permanent C# Developer in Kentish Town : ref:VAC-973549

2014-03-24 Thread Michael Glaze
Hi, I'm currently looking for candidates who might be suitable for a C# Developer position based in Kentish Town and I wondered if you might know anyone who is interested. Salaries are around the £55000 level but might be flexible dependent on experience. Software Developer / Programmer Londo

[HACKERS] Command line argument for Server

2014-03-24 Thread Swapnil Bhoite
Hi, I want to set or reset a global flag. 1) What currently I'm thinking is, I'll declare that global flag in *postgres.h* 2) I'll set that depending on my custom flag given at server startup 3) I encountered function *getopt* but I couldn't understand it So my question is how should I process co

Re: [HACKERS] Patch for CREATE RULE sgml -- Was in: [DOCS]

2014-03-24 Thread Fujii Masao
On Sat, Mar 22, 2014 at 12:56 AM, Emanuel Calvo wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA512 > > > > Hi guys, > > I realized that the output of the CREATE RULE has not a detailed > output for the "events" parameter. > > But the question here is that I'm not sure which format follow:

Re: [HACKERS] Global flag

2014-03-24 Thread Craig Ringer
On 03/24/2014 06:28 PM, Rajashree Mandaogane wrote: > I need to set a global flag in such a way that only if the flag is on > then my modified code will get executed, so how can I do that? PostgreSQL is single-threaded, multi-processing. So if you need to set this flag only within a given backend,

Re: [HACKERS] Standby server won't start

2014-03-24 Thread Fujii Masao
On Sat, Mar 22, 2014 at 9:33 AM, Tatsuo Ishii wrote: >> That's because the parameter is checked at the beginning of recovery >> (i.e. at standby start) before XLOG_PARAMETER_CHANGE is received and >> applied on the standby. Please see CheckRequiredParameterValues() in >> StartupXLOG(). >> >> To p

Re: [HACKERS] Archive recovery won't be completed on some situation.

2014-03-24 Thread Fujii Masao
On Thu, Mar 20, 2014 at 3:43 PM, Kyotaro HORIGUCHI wrote: > Hello, > > At Wed, 19 Mar 2014 19:34:10 +0900, Fujii Masao wrote >> > Agreed. Attached patches do that and I could "recover" the >> > database state with following steps, >> >> Adding new option looks like new feature rather than bug fix.

Re: [HACKERS] Review: plpgsql.extra_warnings, plpgsql.extra_errors

2014-03-24 Thread Simon Riggs
On 24 March 2014 10:58, Petr Jelinek wrote: > Docs updated. OK, it looks to me that all outstanding comments have been resolved. I'll be looking to commit this later today, so last call for comments. -- Simon Riggs http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 S

Re: [HACKERS] Dynamic background workers & docs question

2014-03-24 Thread Michael Paquier
On Mon, Mar 24, 2014 at 5:54 PM, Magnus Hagander wrote: > I was looking at http://www.postgresql.org/docs/devel/static/bgworker.html > with a client today. > > It says: > "Unlike RegisterBackgroundWorker, which can only be called from within the > postmaster,RegisterDynamicBackgroundWorker must be

Re: [HACKERS] Review: plpgsql.extra_warnings, plpgsql.extra_errors

2014-03-24 Thread Petr Jelinek
On 23/03/14 19:38, Pavel Stehule wrote: doc should be enhanced by: Docs updated. -- Petr Jelinek http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services diff --git a/doc/src/sgml/plpgsql.sgml b/doc/src/sgml/plpgsql.sgml index bddd458..2a9b3

[HACKERS] Global flag

2014-03-24 Thread Rajashree Mandaogane
I need to set a global flag in such a way that only if the flag is on then my modified code will get executed, so how can I do that? Thank you.

Re: [HACKERS] using arrays within structure in ECPG

2014-03-24 Thread Boszormenyi Zoltan
2014-03-24 07:22 keltezéssel, Ashutosh Bapat írta: Hi, I tried using integer array within a structure array in ECPG code. But it resulted in some garbage values being printed from the table. Here are the details, The ECPG program is attached (array_test.pgc). It tries to read the contents of t

[HACKERS] Global flag

2014-03-24 Thread Swapnil Bhoite
Hi, I want to set a *global flag* with which I can decide whether to use my code or not in modified source code. How I can do that? Thank you -Swapnil

[HACKERS] Only first XLogRecData is visible to rm_desc with WAL_DEBUG

2014-03-24 Thread Heikki Linnakangas
As we all know, when you compile with WAL_DEBUG, and enable wal_debug GUC, you get output like this in the log for every inserted WAL record: LOG: INSERT @ 0/5407E578: prev 0/5407E4D0; xid 0; len 32: Standby - running xacts: nextXid 774 latestCompletedXid 771 oldestRunningXid 772; 2 xacts: 78

[HACKERS] Dynamic background workers & docs question

2014-03-24 Thread Magnus Hagander
I was looking at http://www.postgresql.org/docs/devel/static/bgworker.htmlwith a client today. It says: "Unlike RegisterBackgroundWorker, which can only be called from within the postmaster,RegisterDynamicBackgroundWorker must be called from a regular backend." Is that the correct restriction? In

Re: [HACKERS] About adding a column to system catalog pg_attribute

2014-03-24 Thread Ashutosh Bapat
Why do you want to add OID to pg_attribute? The relid and attnum would be able to uniquely identify each row of pg_attribute and hence each column of any relation in the database. On Mon, Mar 24, 2014 at 1:10 PM, Tanmay Deshpande wrote: > I want to add a column to system catalog pg_attribute for

[HACKERS] About adding a column to system catalog pg_attribute

2014-03-24 Thread Tanmay Deshpande
I want to add a column to system catalog pg_attribute for getting an oid for a column also. How do we add a column into pg_attribute ?

Re: [HACKERS] Triggers on foreign tables

2014-03-24 Thread Ronan Dunklau
Le dimanche 23 mars 2014 02:44:26 Noah Misch a écrit : > On Tue, Mar 18, 2014 at 09:31:06AM +0100, Ronan Dunklau wrote: > > Le mardi 18 mars 2014 03:54:19 Kouhei Kaigai a écrit : > > > > (1) To acquire the old tuple for UPDATE/DELETE operations, the patch > > > > closely > > > > parallels our ha

[HACKERS] Comment in src/backend/commands/vacuumlazy.c

2014-03-24 Thread Amit Langote
Hi, Note the following comment in src/backend/commands/vacuumlazy.c:lazy_scan_heap() 1088 /* If no indexes, make log report that lazy_vacuum_heap would've made */ 1089 if (vacuumed_pages) 1090 ereport(elevel, Just wondering if it would read better as: 1088 /* Make the log re