[HACKERS] Patch to include c.h

2012-09-16 Thread Gurjeet Singh
, but these are the ones I found on my first attempts to use this IDE. Best regards, -- Gurjeet Singh http://gurjeet.singh.im/ include_c.h.patch Description: Binary data -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription:

Re: [HACKERS] Patch to include c.h

2012-09-17 Thread Gurjeet Singh
On Sun, Sep 16, 2012 at 11:52 AM, Tom Lane wrote: > Gurjeet Singh writes: > > I noticed that xlog.h uses PGDLLIMPORT, but it does not include c.h > > directly or indirectly. > > In general, all include files in Postgres assume that you've included > postgres.h or

Re: [HACKERS] [BUGS] log : bad file dscriptor????

2010-03-11 Thread Gurjeet Singh
On Wed, Mar 18, 2009 at 3:47 AM, Heikki Linnakangas < heikki.linnakan...@enterprisedb.com> wrote: > Gurjeet Singh wrote: > >>On Windows, the write to log file is done by a thread (whose main >> function is pipeThread() ), and since it works completely independent of

[HACKERS] Repeating Append operation

2010-03-19 Thread Gurjeet Singh
Hi all, explain select v from ( select array( select 1 union all select 2) as v from (select 1) ) as s where v is not null; The plan looks like: QUERY PLAN Result (cost=0.08..0.10 rows=1 wid

Re: [HACKERS] Repeating Append operation

2010-03-23 Thread Gurjeet Singh
On Sun, Mar 21, 2010 at 4:29 PM, Robert Haas wrote: > On Fri, Mar 19, 2010 at 2:09 PM, Gurjeet Singh > wrote: > > Is there a way to avoid this double evaluation? > > Maybe with a CTE? > > WITH x AS (...) SELECT ... > > It does look like surprising behavior.

[HACKERS] GUCs that need restart

2010-05-04 Thread Gurjeet Singh
There are quite a few GUC parameters that need restart. Is there a way we can avoid some of them needing restart? I am specifically looking at archive_mode and the new wal_level. >From my limited understanding, these parameters need restart because in a running cluster we cannot safely change thes

[HACKERS] A table for ALTER TABLE .. ENABLE TRIGGER combining session_replication_role GUC

2012-05-21 Thread Gurjeet Singh
mmand| origin | replica | local | +++-+---+ | ENABLE TRIGGER | x| | x | | ENABLE REPLICA TRIGGER ||x| | | ENABLE ALWAYS TRIGGER | x|x| x | ++----+-----+---+ Regards, -- Gurjeet Singh EnterpriseDB Corporation The Enterprise PostgreSQL Company

Re: [HACKERS] Creating multiple indexes in one table scan.

2012-05-24 Thread Gurjeet Singh
On Thu, May 24, 2012 at 11:22 AM, Stephen Frost wrote: > * Gurjeet Singh (singh.gurj...@gmail.com) wrote: > > Bruce points out the even simpler case is to build several indexes in > > parallel over the same scan. > > > > I thought I had posted a patch to that

Re: [HACKERS] Ability to listen on two unix sockets

2012-06-07 Thread Gurjeet Singh
as a wrapper around FE/BE), and I found it difficult (not impossible) to use the same port for communicating FE/BE protocol and for https+WebSockets too. It would have been a lot simpler if I could say that WebSockets is enabled on 5431 and FE/BE on 5432. Regards, -- Gurjeet Singh EnterpriseDB Corporation The Enterprise PostgreSQL Company

Re: [HACKERS] Patch pg_is_in_backup()

2012-06-14 Thread Gurjeet Singh
ile_access(), +errmsg("could not read file \"%s\": %m", + BACKUP_LABEL_FILE))); + } + If ferror(lfp) returns false, wouldn't we miss the FreeFile() and leak a file pointer? Regards, -- Gurjeet Singh EnterpriseDB Corporation The Enterprise PostgreSQL Company

Re: [HACKERS] Patch pg_is_in_backup()

2012-06-14 Thread Gurjeet Singh
On Thu, Jun 14, 2012 at 2:02 PM, Robert Haas wrote: > On Thu, Jun 14, 2012 at 1:48 PM, Gurjeet Singh > wrote: > > On Thu, Jun 14, 2012 at 1:29 PM, Robert Haas > wrote: > >> Committed. > > > > > > A minor gripe: > > > > + /* > > +

Re: [HACKERS] Patch pg_is_in_backup()

2012-06-14 Thread Gurjeet Singh
On Thu, Jun 14, 2012 at 3:20 PM, Robert Haas wrote: > Also, you had > the same primary content for both comments, and you incorrectly > reversed the sense of the FreeFile() test. > I am known for my fat fingers :) > Committed with those changes. > Thanks! -- Gurjeet

Re: [HACKERS] REVIEW: Optimize referential integrity checks (todo item)

2012-06-17 Thread Gurjeet Singh
rsions, and yet the 'Total runtime' is lower for the patched versions. I would've expected 'Total runtime' to be proportional to the increase in top-level row-source's 'actual time'. Even the time consumed by Seq scans is higher in patched version, so I think the patch's affect on performance needs to be evaluated. Best regards, -- Gurjeet Singh EnterpriseDB Corporation The Enterprise PostgreSQL Company

Re: [HACKERS] s/UNSPECIFIED/SIMPLE/ in foreign key code?

2012-06-18 Thread Gurjeet Singh
For some reason I thought this change would break pg_upgrade, but then I came to me senses and realized pg_upgrade does not migrate/upgrade system tables. The other candidate to look for possible breakage would be pgAdmin. As Amit says, there might be code out in the wild that does look at thi

Re: [HACKERS] Schema version management

2012-07-05 Thread Gurjeet Singh
to keeping all overloaded variations of a function in a single file, apart from the simplicity and benefits noted above. A change in one variation of the function may also be applicable to other variations, say in bug-fixes or enhancements. So keeping all variations in one file would make sense,

[HACKERS] Allow replacement of bloated primary key indexes without foreign key rebuilds

2012-07-06 Thread Gurjeet Singh
egclass, refobjid, case refclassid::regclass::text when 'pg_class' then refobjid::regclass::text when 'pg_type' then refobjid::regtype::text when 'pg_constraint' then (select conname from pg_constraint where oid = refobjid) when 'pg_namespace' then (select nspnam

Re: FW: [HACKERS] Allow replacement of bloated primary key indexes without foreign key rebuilds

2012-07-12 Thread Gurjeet Singh
; ALTER INDEX ind REPLACE WITH new_index; > > After this new syntax there will be 2 ways for users to do the replacement > of index, won’t it confuse users for which syntax to use? > Yes, I forgot to mention this in the original post. This feature will be a superset of the feature we introduced in ALTER TABLE. I don't see a way around that, except for slowly deprecating the older feature. -- Gurjeet Singh EnterpriseDB Corporation The Enterprise PostgreSQL Company

Re: [HACKERS] Re: Allow replacement of bloated primary key indexes without foreign key rebuilds

2012-07-12 Thread Gurjeet Singh
On Tue, Jul 10, 2012 at 10:44 AM, Tom Lane wrote: > Greg Stark writes: > > On Sat, Jul 7, 2012 at 4:53 AM, Gurjeet Singh > wrote: > >> All we need to do is allow swapping of pg_class.relfilenode of two > indexes. > > > Fwiw I don't like swapping re

Re: [HACKERS] Re: Allow replacement of bloated primary key indexes without foreign key rebuilds

2012-07-12 Thread Gurjeet Singh
the same set of properties that CREATE CONSTRAINT looks > for to find a satisfactory index to depend on. > I like the DROP index idea, but the silent side-effect may not make people happy. Can you give me a pointer to relevant code. -- Gurjeet Singh EnterpriseDB Corporation The Enterprise PostgreSQL Company

Re: [HACKERS] Getting rid of pre-assignment of index names in CREATE TABLE LIKE

2012-07-15 Thread Gurjeet Singh
gt; use these interfaces. > > I would like to sneak this fix into 9.2, though. Does anyone think > it's already too late to be touching these APIs for 9.2? > I'd like us to stick to the standard practice of not changing features/API in beta releases. Best regards, -- Gurjeet Singh EnterpriseDB Corporation The Enterprise PostgreSQL Company

Re: [HACKERS] Getting rid of pre-assignment of index names in CREATE TABLE LIKE

2012-07-15 Thread Gurjeet Singh
On Sun, Jul 15, 2012 at 11:49 AM, Tom Lane wrote: > Gurjeet Singh writes: > > On Sat, Jul 14, 2012 at 4:02 PM, Tom Lane wrote: > >> I would like to sneak this fix into 9.2, though. Does anyone think > >> it's already too late to be touching these APIs for 9.

Re: [HACKERS] [COMMITTERS] pgsql: Introduce latches.

2010-09-11 Thread Gurjeet Singh
Portions Copyright (c) 1994, Regents of the University of California Is that line needed for new files introduced by the Community? Regards, On Sat, Sep 11, 2010 at 11:48 AM, Heikki Linnakangas wrote: > Log Message: > --- > Introduce latches. A latch is a boolean variable, with the capa

[HACKERS] Re: [COMMITTERS] pgsql: git_topo_order script, to match up commits across branches.

2010-09-24 Thread Gurjeet Singh
On Fri, Sep 24, 2010 at 6:09 PM, Alvaro Herrera wrote: > Excerpts from Tom Lane's message of vie sep 24 17:36:59 -0400 2010: > > Robert Haas writes: > > > On Sep 24, 2010, at 3:32 PM, Tom Lane wrote: > > >> BTW ... I don't especially care for the name you picked for this > script. > > >> The fac

Re: [HACKERS] What happened to the is_ family of functions proposal?

2010-09-25 Thread Gurjeet Singh
On Fri, Sep 24, 2010 at 11:15 PM, Robert Haas wrote: > On Fri, Sep 24, 2010 at 3:41 PM, Tom Lane wrote: > > Robert Haas writes: > >> On Tue, Sep 21, 2010 at 7:05 PM, Tom Lane wrote: > >>> There are many rules that you could possibly make for type input > >>> functions. But "you cannot throw a

Re: [HACKERS] [COMMITTERS] pgsql: Still more tweaking of git_changelog.

2010-09-26 Thread Gurjeet Singh
On Sun, Sep 26, 2010 at 3:24 PM, Tom Lane wrote: > We could perhaps fix that if there were an inexpensive way to get the > SHA1 of the master commit that each branch is sprouted from. However, > I'm inclined to propose that we instead manually place a tag at each > sprout point. Any thoughts ab

Re: [HACKERS] [COMMITTERS] pgsql: Still more tweaking of git_changelog.

2010-09-26 Thread Gurjeet Singh
On Mon, Sep 27, 2010 at 3:03 AM, Robert Haas wrote: > On Sun, Sep 26, 2010 at 8:24 PM, Tom Lane wrote: > > > > I maintain that if someone else whacked around one of your commits the > way you whacked this around, you'd bite their head off. > > :) Yes, he would. And you are not being any less for

Re: [HACKERS] [COMMITTERS] pgsql: Still more tweaking of git_changelog.

2010-09-26 Thread Gurjeet Singh
On Mon, Sep 27, 2010 at 3:20 AM, Robert Haas wrote: > On Sun, Sep 26, 2010 at 9:14 PM, Gurjeet Singh > wrote: > > On Mon, Sep 27, 2010 at 3:03 AM, Robert Haas > wrote: > >> > >> On Sun, Sep 26, 2010 at 8:24 PM, Tom Lane wrote: > >> > > >&g

[HACKERS] Improving prep_buildtree used in VPATH builds

2010-09-26 Thread Gurjeet Singh
Attached is the patch that tries to speedup prep_buildtree script, which is used in VPATH builds, from our configure script. The idea is to ask `find` to emit directory listing in depth-first order so that the `mkdir -p` will create the deepest directory first and any subsequent `mkdir -p` on an i

Re: [HACKERS] Improving prep_buildtree used in VPATH builds

2010-09-27 Thread Gurjeet Singh
On Mon, Sep 27, 2010 at 3:02 PM, Robert Haas wrote: > On Sun, Sep 26, 2010 at 10:15 PM, Gurjeet Singh > wrote: > > I have been away from Postgres development for quite a while, so would > > appreciate if someone could tell me if such a patch should be submitted > for >

Re: [HACKERS] Improving prep_buildtree used in VPATH builds

2010-09-27 Thread Gurjeet Singh
On Mon, Sep 27, 2010 at 4:15 PM, Andrew Dunstan wrote: > > > On 09/27/2010 10:11 AM, Robert Haas wrote: > >> >> What should be the value of 'Message-ID for original patch' ? >>> the URL: >>> http://archives.postgresql.org/pgsql-hackers/2010-09/msg01837.php >>> or the ID: >>> aanlktinw0hl+jqmrtw

Re: [HACKERS] Improving prep_buildtree used in VPATH builds

2010-09-27 Thread Gurjeet Singh
On Mon, Sep 27, 2010 at 7:21 PM, Tom Lane wrote: > Alvaro Herrera writes: > > Excerpts from Gurjeet Singh's message of dom sep 26 22:15:59 -0400 2010: > >> Currently I am seeing a performance improvement of this script by only > about > >> 500 ms; say 11.8 seconds vs. 11.3 secs. But I remember d

Re: [HACKERS] security label support, revised

2010-09-28 Thread Gurjeet Singh
On Tue, Sep 28, 2010 at 3:22 PM, Robert Haas wrote: > On Tue, Sep 28, 2010 at 8:03 AM, Peter Eisentraut wrote: > > On tis, 2010-09-28 at 13:53 +0200, Magnus Hagander wrote: > >> On Tue, Sep 28, 2010 at 13:50, Robert Haas > wrote: > >> > On Tue, Sep 28, 2010 at 3:57 AM, Shigeru HANADA > >> >> Th

[HACKERS] Patch to reindex primary keys

2010-09-29 Thread Gurjeet Singh
Attached is a patch that implements replacing a primary key with another index. This would help overcome the limitation that primary keys cannot be reindexed without taking exclusive locks. The use case is to create an identical index, concurrenlty, with the same structure as the primary k

Re: [HACKERS] git diff --patience

2010-09-30 Thread Gurjeet Singh
Attached are two versions of the same patch, with and without --patience. The with-patience version has only two hunks, removal of a big block of comment and addition of a big block of code. The without-patience patience is riddled with the mix of two hunks, spread until line 120. --patience is

[HACKERS] Patch author name on commitfest page

2010-09-30 Thread Gurjeet Singh
Can we please change the comment lines below the patch heading to have the real name instead of the postgresql.org ID? Patch by Pavel Stehule Patch by Gurjeet Singh instead of Patch by okbobcz Patch by singh.gurjeet https://commitfest.postgresql.org/action/commitfest_view?id=8 Thanks

Re: [HACKERS] Patch author name on commitfest page

2010-09-30 Thread Gurjeet Singh
On Thu, Sep 30, 2010 at 11:45 PM, Robert Haas wrote: > On Thu, Sep 30, 2010 at 5:38 PM, Gurjeet Singh > wrote: > > Can we please change the comment lines below the patch heading to have > the > > real name instead of the postgresql.org ID? > > > > Patch by P

Re: [HACKERS] git diff --patience

2010-10-01 Thread Gurjeet Singh
On Fri, Oct 1, 2010 at 9:38 AM, Alvaro Herrera wrote: > Excerpts from Kevin Grittner's message of jue sep 30 16:38:11 -0400 2010: > > > When I read the description of the algorithm, I can't imagine a > > situation where --patience would make the diff *worse*. I was > > somewhat afraid (based on t

[HACKERS] PG-Git usernames

2010-10-01 Thread Gurjeet Singh
I hope this is the right forum to talk about git.postgresql.org My community login is singh.gurjeet, but our setup seems to not like the special character there; users/singh.gurjeet/postgres is rejected. Would it be a problem if I requested users/gsingh/postgres ? I hope that doesn't cause any tr

Re: [HACKERS] PG-Git usernames

2010-10-01 Thread Gurjeet Singh
On Fri, Oct 1, 2010 at 10:00 AM, Magnus Hagander wrote: > On Fri, Oct 1, 2010 at 15:50, Gurjeet Singh > wrote: > > I hope this is the right forum to talk about git.postgresql.org > > > > My community login is singh.gurjeet, but our setup seems to not like the > >

Re: [HACKERS] Patch to add a primary key using an existing index

2010-10-09 Thread Gurjeet Singh
On Sat, Oct 9, 2010 at 2:07 PM, Gurjeet Singh wrote: > This is a continuation from this thread: > http://archives.postgresql.org/pgsql-hackers/2010-09/msg02153.php > > The attached patch allows creating a primary key using an existing index. > > I have attached two versions of

Re: archives, attachments, etc (was: [HACKERS] Patch to add a primary key using an existing index)

2010-10-09 Thread Gurjeet Singh
On Sat, Oct 9, 2010 at 3:30 PM, Dimitri Fontaine wrote: > Andrew Dunstan writes: > > I wish we could get the archive processor to provide access to the > > attachments even if they have a MIME type of text/whatever. That's a > > horrid inefficiency. Maybe we could restrict it to text attachments

Re: [HACKERS] .gitignore files, take two

2010-10-09 Thread Gurjeet Singh
On Tue, Sep 21, 2010 at 12:55 AM, Robert Haas wrote: > All the build products in a normal build. One of the infelicities of > git is that 'git status' shows the untracked files at the bottom. So > if you have lots of unignored stuff floating around, the information > about which files you've ac

Re: [HACKERS] Issues with two-server Synch Rep

2010-10-11 Thread Gurjeet Singh
On Mon, Oct 11, 2010 at 7:16 PM, Jeff Davis wrote: > On Mon, 2010-10-11 at 16:07 -0400, Robert Haas wrote: > > >> It would be far better if we could decouple master cleanup from > > >> standby cleanup, so that only the machine that actually has the old > > >> query gets bloated. However, no one

[HACKERS] Protecting against unexpected zero-pages: proposal

2010-11-06 Thread Gurjeet Singh
A customer of ours is quite bothered about finding zero pages in an index after a system crash. The task now is to improve the diagnosability of such an issue and be able to definitively point to the source of zero pages. The proposed solution below has been vetted in-house at EnterpriseDB and am

Re: [HACKERS] Protecting against unexpected zero-pages: proposal

2010-11-06 Thread Gurjeet Singh
On Sat, Nov 6, 2010 at 11:48 PM, Tom Lane wrote: > Gurjeet Singh writes: > > .) The basic idea is to have a magic number in every PageHeader before it > is > > written to disk, and check for this magic number when performing page > > validity > > checks. > &

Re: [HACKERS] Patch to add a primary key using an existing index

2010-11-07 Thread Gurjeet Singh
ollow the Git branch here: https://github.com/gurjeet/postgres/tree/replace_pkey_index Regards, On Mon, Nov 1, 2010 at 10:29 PM, Jim Nasby wrote: > UNIQUE constraints suffer from the same behavior; feel like fixing that > too? :) > > On Oct 9, 2010, at 1:07 PM, Gurjeet Singh wrote

Re: [HACKERS] Patch to add a primary key using an existing index

2010-11-07 Thread Gurjeet Singh
fixing that >> too? :) >> >> On Oct 9, 2010, at 1:07 PM, Gurjeet Singh wrote: >> >> > This is a continuation from this thread: >> http://archives.postgresql.org/pgsql-hackers/2010-09/msg02153.php >> > >> > The attached patch allows creating a prim

Re: [HACKERS] Protecting against unexpected zero-pages: proposal

2010-11-09 Thread Gurjeet Singh
On Tue, Nov 9, 2010 at 12:32 AM, Tom Lane wrote: > There are also crosschecks that you can apply: if it's a heap page, are > there any index pages with pointers to it? If it's an index page, are > there downlink or sibling links to it from elsewhere in the index? > A page that Postgres left as z

[HACKERS] DROP TABLESPACE needs crash-resistance

2010-11-09 Thread Gurjeet Singh
We are facing a problem in dropping a tablespace after crash recovery. The recovery starts from the last checkpoint, but the tables that were created by a transaction in a tablespace before the checkpoint are still lying around; the transaction had not finished by the time of crash. After recovery

Re: [HACKERS] Protecting against unexpected zero-pages: proposal

2010-11-09 Thread Gurjeet Singh
On Wed, Nov 10, 2010 at 1:15 AM, Tom Lane wrote: > Once you know that there is, or isn't, > a filesystem-level error involved, what are you going to do next? > You're going to go try to debug the component you know is at fault, > that's what. And that problem is still AI-complete. > > If we know

Re: [HACKERS] DROP TABLESPACE needs crash-resistance

2010-11-09 Thread Gurjeet Singh
On Wed, Nov 10, 2010 at 1:24 AM, Tom Lane wrote: > Gurjeet Singh writes: > > We are facing a problem in dropping a tablespace after crash recovery. > The > > recovery starts from the last checkpoint, but the tables that were > created > > by > > a trans

Re: [HACKERS] Patch to add a primary key using an existing index

2010-11-22 Thread Gurjeet Singh
On Sat, Nov 20, 2010 at 9:00 AM, Steve Singer wrote: > > Submission Review: > > > Tests > > The expected output for the regression tests you added don't match > what I'm getting when I run the tests with your patch applied. > I think you just need to regenerate th

[HACKERS] Double ocurring Subplan

2011-05-13 Thread Gurjeet Singh
ing tz_test_hist_rec_time_idx on tz_test_history h2 (cost=0.00..10800.38 rows=4800 width=8) (actual time=0.058..0.058 rows=1 loops=1) Index Cond: ((recorded_time IS NOT NULL) AND (recorded_time < $1)) Filter: (server_id = $0) Total

Re: [HACKERS] Double ocurring Subplan

2011-05-13 Thread Gurjeet Singh
On Fri, May 13, 2011 at 6:02 PM, Tom Lane wrote: > Gurjeet Singh writes: > > I am listing the query, it's explain output and explain analyze output at > > the end. > > > The EXPLAIN output shows the 'Subplan 2' node only once, whereas EXPLAIN > >

Re: [HACKERS] Review: psql include file using relative path

2011-05-20 Thread Gurjeet Singh
ample) > > Yes, I just followed the precedent; that line still crosses the 80 column limit, though. I'd leave for a pgindent run or the commiter to fix as I don't know what the right fix would be. > > That's it for now. Overall, I think this patch provides a useful > feat

Re: [HACKERS] Review: psql include file using relative path

2011-05-20 Thread Gurjeet Singh
f the patch to "Waiting on Author" pending resolution of the issues > you observed. > > Well, that was added to commitfest about 3 months ago, which is great because somebody reviewed it without me having to resubmit it. New patch submitted and marked as 'Needs Review'. Thank

Re: [HACKERS] Review: psql include file using relative path

2011-06-05 Thread Gurjeet Singh
On Sat, May 21, 2011 at 11:59 AM, Josh Kupershmidt wrote: > On Fri, May 20, 2011 at 2:35 PM, Gurjeet Singh > wrote: > > On Sat, May 14, 2011 at 5:03 PM, Josh Kupershmidt > > wrote: > > Thanks a lot for the review. My responses are inline below. > > Thanks for th

Re: [HACKERS] Review: psql include file using relative path

2011-06-05 Thread Gurjeet Singh
On Sun, Jun 5, 2011 at 1:06 PM, Josh Kupershmidt wrote: > On Sun, Jun 5, 2011 at 10:21 AM, Gurjeet Singh > wrote: > > On Sat, May 21, 2011 at 11:59 AM, Josh Kupershmidt > > wrote: > > > Tweaks applied, but omitted the C variable names as I don't think that

Re: [HACKERS] Review: psql include file using relative path

2011-06-06 Thread Gurjeet Singh
On Mon, Jun 6, 2011 at 9:48 PM, Josh Kupershmidt wrote: > On Sun, Jun 5, 2011 at 8:16 PM, Gurjeet Singh > wrote: > > Attached an updated patch. > > > > If you find it ready for committer, please mark it so in the commitfest > app. > > I can't find anyth

Re: [HACKERS] Creating new remote branch in git?

2011-06-10 Thread Gurjeet Singh
igin new_branch >From here on I work as if that new_branch was handed to me from the origin. I believe this also takes care of setting up the .git/config file properly. Just in case it is needed: to delete a branch on remote, just do git push origin :new_branch It will keep your local branc

Re: [HACKERS] procpid?

2011-06-15 Thread Gurjeet Singh
. backend_start is never NULL, so we can fall back on that when nothing else is available (i.e when the backend has just started). If we separated is_idle and is_idle_in_transaction into separate fields, then we also need to somehow expose when did the backend get into that state, unless we promise to hold the assumptions true that were made when writing the above query (which is not as straightforward as one would expect). -- Gurjeet Singh EnterpriseDB Corporation The Enterprise PostgreSQL Company

Re: [HACKERS] procpid?

2011-06-15 Thread Gurjeet Singh
tead of a new view, like we do for pg_is_in_replication(). People can use whatever alias they want in the queries they write. SELECT get_current_query(pid), is_idle(pid), is_idle_in_transaction(pid), transaction_start_time(pid), .... FROM (select procpid as pid FROM pg_stat_activity); Then pg_activity (or whatever we name it later) would also be a view on top of these functions. -- Gurjeet Singh EnterpriseDB Corporation The Enterprise PostgreSQL Company

Re: [HACKERS] procpid?

2011-06-15 Thread Gurjeet Singh
On Wed, Jun 15, 2011 at 10:31 AM, Robert Haas wrote: > On Wed, Jun 15, 2011 at 9:44 AM, Gurjeet Singh > wrote: > > Why not expose this new information as functions instead of a new view, > like > > we do for pg_is_in_replication(). People can use whatever alias they want

Re: [HACKERS] SYNONYMS (again)

2011-06-23 Thread Gurjeet Singh
On Thu, Jun 23, 2011 at 2:58 PM, Kevin Grittner wrote: > Gurjeet Singh wrote: > > > Instead of just synonyms of columns, why don't we think about > implementing > > virtual columns (feature as named in other RDBMS). This is the > ability to > > define a colum

Re: [HACKERS] SYNONYMS (again)

2011-06-23 Thread Gurjeet Singh
). This is the ability to define a column in a table which is derived using an expression around other non-virtual columns. I agree it would be much more difficult and some may even argue it is pointless in the presence of views and expression indexes, but I leave that as an exercise for others.

Re: [HACKERS] Review: psql include file using relative path

2011-07-06 Thread Gurjeet Singh
On Wed, Jul 6, 2011 at 11:58 AM, Robert Haas wrote: > On Mon, Jun 6, 2011 at 10:11 PM, Gurjeet Singh > wrote: > > On Mon, Jun 6, 2011 at 9:48 PM, Josh Kupershmidt > wrote: > >> > >> On Sun, Jun 5, 2011 at 8:16 PM, Gurjeet Singh > >> wrote: > >

Re: [HACKERS] Patch to add a primary key using an existing index

2011-01-25 Thread Gurjeet Singh
On Wed, Jan 26, 2011 at 5:31 AM, Tom Lane wrote: > In the end I think this is mainly an issue of setting appropriate > expectations in the documentation. I've added the following text to > the ALTER TABLE manual page: > > > After this command is executed, the index is owned by the >

Re: [HACKERS] Patch to add a primary key using an existing index

2011-01-26 Thread Gurjeet Singh
On Wed, Jan 26, 2011 at 6:14 AM, Tom Lane wrote: > Gurjeet Singh writes: > > Attached is the updated patch with doc changes and test cases. > > Applied with assorted corrections. Aside from the refactoring I wanted, > there were various oversights. > Looking at the commit

[HACKERS] Re: [COMMITTERS] pgsql: Update docs on building for Windows to accomodate current realit

2011-02-09 Thread Gurjeet Singh
This commit refers to www.mingw64.org which does not exist. Also, clicking on the gitweb link below (from GMail), opens the browser window with an address where ';' are replaced with %3B , which leads to 404 - no such project. Is GMail broken, or can have gitweb treat %3B as a ; ? Regards, On Mo

[HACKERS] Fix for Index Advisor related hooks

2011-02-11 Thread Gurjeet Singh
Looks like the function get_actual_variable_range() was written with the knowledge that virtual/hypothetical indexes may exist, but the assumption seems wrong. One one hand get_actual_variable_range() expects that virtual indexes do not have an OID assigned, on the other hand explain_get_index_na

Re: [HACKERS] Fix for Index Advisor related hooks

2011-02-15 Thread Gurjeet Singh
On Tue, Feb 15, 2011 at 8:24 AM, Heikki Linnakangas < heikki.linnakan...@enterprisedb.com> wrote: > On 11.02.2011 22:44, Gurjeet Singh wrote: > >> Looks like the function get_actual_variable_range() was written with the >> knowledge that virtual/hypothetical indexes may e

Re: [HACKERS] Fix for Index Advisor related hooks

2011-02-16 Thread Gurjeet Singh
On Tue, Feb 15, 2011 at 11:59 AM, Tom Lane wrote: > Gurjeet Singh writes: > > Also attached is the patch expose_IndexSupportInitialize.patch, that > makes > > the static function IndexSupportInitialize() global so that the Index > > Advisor doesn't have to reinvent

Re: [HACKERS] Fix for Index Advisor related hooks

2011-02-16 Thread Gurjeet Singh
On Tue, Feb 15, 2011 at 12:51 PM, Tom Lane wrote: > Gurjeet Singh writes: > > On Tue, Feb 15, 2011 at 8:24 AM, Heikki Linnakangas < > > heikki.linnakan...@enterprisedb.com> wrote: > >> On 11.02.2011 22:44, Gurjeet Singh wrote: > >>> One one hand get_ac

Re: [HACKERS] Fix for Index Advisor related hooks

2011-02-16 Thread Gurjeet Singh
On Wed, Feb 16, 2011 at 10:25 AM, Tom Lane wrote: > Gurjeet Singh writes: > > I understand that we need to hide guts of an implementation. But without > > this the Index Advisor will have to emulate what LookupOpclassInfo() does > > and that's a lot of code that I

Re: [HACKERS] Fix for Index Advisor related hooks

2011-02-16 Thread Gurjeet Singh
On Wed, Feb 16, 2011 at 10:26 AM, Tom Lane wrote: > Gurjeet Singh writes: > > BTW, you use the term 'fictitious' in the comments, would it be > better > > to standardize the term used for such an index? So either the comment > would > > be changed to c

Re: [HACKERS] Fix for Index Advisor related hooks

2011-02-16 Thread Gurjeet Singh
On Wed, Feb 16, 2011 at 7:25 PM, Tom Lane wrote: > Gurjeet Singh writes: > > On Wed, Feb 16, 2011 at 10:26 AM, Tom Lane wrote: > >> Yeah, hypothetical is the more-established term I think. > > > Please find the patch attached. > > Applied with minor adjustmen

Re: [HACKERS] Fix for Index Advisor related hooks

2011-02-17 Thread Gurjeet Singh
On Wed, Feb 16, 2011 at 6:37 PM, Tom Lane wrote: > Gurjeet Singh writes: > > On Wed, Feb 16, 2011 at 10:25 AM, Tom Lane wrote: > >> The only reason you'd need that code is if you were trying to construct > >> a fake Relation structure, which seems unnecessary an

Re: [HACKERS] Fix for Index Advisor related hooks

2011-02-18 Thread Gurjeet Singh
On Fri, Feb 18, 2011 at 2:27 AM, Heikki Linnakangas < heikki.linnakan...@enterprisedb.com> wrote: > On 17.02.2011 14:30, Gurjeet Singh wrote: > >> On Wed, Feb 16, 2011 at 6:37 PM, Tom Lane wrote: >> >> Fetch the values you need and stuff 'em in the struct. Don

Re: [HACKERS] Fix for Index Advisor related hooks

2011-02-23 Thread Gurjeet Singh
On Fri, Feb 18, 2011 at 1:36 PM, Heikki Linnakangas < heikki.linnakan...@enterprisedb.com> wrote: > On 18.02.2011 17:02, Gurjeet Singh wrote: > > Another use case of the Index Advisor is to be switched on for a few hours >> while the application runs, and gather the recommen

[HACKERS] Fwd: psql include file using relative path

2011-02-24 Thread Gurjeet Singh
g subdir2/1.sql \ir subdir2.1/1.sql === ./subdir2/2.sql \echo processing subdir2/2.sql === ./subdir2/3.sql \echo processing subdir2/3.sql Regards, -- Gurjeet Singh EnterpriseDB Corporation <http://www.enterprisedb.com/> The Enterprise PostgreSQL <http://www.postgresql.org/> Company dif

Re: [HACKERS] Fwd: psql include file using relative path

2011-03-08 Thread Gurjeet Singh
t Haas > wrote: > > On Thu, Feb 24, 2011 at 6:21 PM, Gurjeet Singh > wrote: > >> psql has the ability to execute commands from a file, but if one > wishes > >> to develop and provide a modularized set of sql files, then psql is not > very > >> helpf

Re: [HACKERS] Fwd: psql include file using relative path

2011-03-09 Thread Gurjeet Singh
eature, but > should it have a UI (well, API) distinct from fixed-path includes? My > first instinct is that it shouldn't, but I haven't really thought it > through thoroughly. > > Cheers, > David (the tough coughs as he ploughs the dough) > On Tue, Mar 08, 2011 a

Re: [HACKERS] Fwd: psql include file using relative path

2011-03-09 Thread Gurjeet Singh
On Wed, Mar 9, 2011 at 7:32 PM, David Fetter wrote: > On Wed, Mar 09, 2011 at 07:05:19PM -0500, Gurjeet Singh wrote: > > Good question, I hadn't thought of that either, and thinking about > > it a bit I think we'd want to keep the current behaviour of \i and > > pr

Re: [HACKERS] Fwd: psql include file using relative path

2011-03-09 Thread Gurjeet Singh
g processed currently. So, I think tab-completion makes sense for this command. And if someone wishes they can stop using \i altogether and \ir will give them old and new bheaviour seamlessly. Regards, -- Gurjeet Singh EnterpriseDB <http://www.enterprisedb.com/> Corporation The Enterprise PostgreSQL <http://www.postgresql.org/> Company

[HACKERS] Missing semicolon in parser's gram.y

2011-03-21 Thread Gurjeet Singh
Attached is a single-line patch to add a missing semicolon to gram.y; caught using yyextract. Regards, -- Gurjeet Singh EnterpriseDB Corporation The Enterprise PostgreSQL Company diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index d32e480..44c4fd6 100644 --- a/src/backend

Re: [HACKERS] 2nd Level Buffer Cache

2011-03-25 Thread Gurjeet Singh
; on this topic. I don't have any machine with that kind of RAM. > I can sponsor a few hours (say 10) of one High-memory on-demand Quadruple Extra Large instance (26 EC2 Compute Units (8 virtual cores with 3.25 EC2 Compute Units each), 1690 GB of local instance storage, 64-bit platform). That's the largest memory AWS has. Let me know if I can help. Regards, -- Gurjeet Singh EnterpriseDB Corporation The Enterprise PostgreSQL Company

Re: [HACKERS] Needs Suggestion

2011-03-27 Thread Gurjeet Singh
ur purpose, then you need elaborate what exactly are you looking for. Regards, -- Gurjeet Singh EnterpriseDB Corporation The Enterprise PostgreSQL Company

Re: [HACKERS] Needs Suggestion

2011-03-27 Thread Gurjeet Singh
In these (Postgres) mailing lists, top-posting is not preferred. See my response below. On Sun, Mar 27, 2011 at 1:01 PM, SUBHAM ROY wrote: > > On Sun, Mar 27, 2011 at 10:20 PM, Gurjeet Singh > wrote: > >> On Sun, Mar 27, 2011 at 9:22 AM, SUBHAM ROY wrote: >> >

Re: [HACKERS] Triggers on system catalog

2011-03-28 Thread Gurjeet Singh
t you were trying to achieve. Regards, -- Gurjeet Singh EnterpriseDB Corporation The Enterprise PostgreSQL Company

Re: [HACKERS] Triggers on system catalog

2011-03-29 Thread Gurjeet Singh
am using postgres 9.0 version. > > Thanks, > Shridhar > > > > On Mon, Mar 28, 2011 at 8:03 PM, Gurjeet Singh wrote: > >> On Mon, Mar 28, 2011 at 10:19 AM, Shridhar Polas > > wrote: >> >>> Hi, >>> >>> Is there a way to create triggers on

Re: [HACKERS] Problem with pg_upgrade?

2011-03-31 Thread Gurjeet Singh
On Wed, Mar 30, 2011 at 10:57 AM, Bruce Momjian wrote: > > I am hearing only second-hand reports of this problem through > Rhodiumtoad on IRC. I don't have IRC access this week If the firewalls allow port 80, you can use Freenode's web interface: webchat.freenode.net R

Re: [HACKERS] Proof of concept: standalone backend with full FE/BE protocol

2013-11-20 Thread Gurjeet Singh
ust that it's establishing trust in the opposite direction. Best regards, -- Gurjeet Singh http://gurjeet.singh.im/ EnterprsieDB Inc. www.enterprisedb.com

Re: [HACKERS] Shave a few instructions from child-process startup sequence

2013-11-22 Thread Gurjeet Singh
On Wed, Nov 20, 2013 at 10:21 AM, Peter Eisentraut wrote: > On 11/5/13, 2:47 AM, Gurjeet Singh wrote: > > On Mon, Nov 4, 2013 at 12:20 AM, Tom Lane > <mailto:t...@sss.pgh.pa.us>> wrote: > > > > But we're not buying much. A few instructions during

[HACKERS] Cleaner build output when not much has changed

2013-11-26 Thread Gurjeet Singh
the recipe that emits the message "All of PostgreSQL successfully made. Ready to install." For really quiet builds one can use the -s switch, but for someone who wishes to see some kind of progress and also want a cleaner terminal output, the --no-print-directory switch alone

Re: [HACKERS] Cleaner build output when not much has changed

2013-11-26 Thread Gurjeet Singh
On Tue, Nov 26, 2013 at 12:37 PM, Tom Lane wrote: > Gurjeet Singh writes: > > I was looking for ways to reduce the noise in Postgres make output, > > specifically, I wanted to eliminate the "Nothing to be done for `all' " > > messages, since they don't a

Re: [HACKERS] Shave a few instructions from child-process startup sequence

2013-11-26 Thread Gurjeet Singh
Best regards, -- Gurjeet Singh http://gurjeet.singh.im/ EnterprsieDB Inc. www.enterprisedb.com diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index ccb8b86..cdae6e5 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.

Re: [HACKERS] Shave a few instructions from child-process startup sequence

2013-12-01 Thread Gurjeet Singh
s a few instructions. I don't know how to write a test case that can measure savings of skipping a few instructions in a startup sequence that potentially takes thousands, or even millions, of instructions. Best regards, -- Gurjeet Singh http://gurjeet.singh.im/ EDB Corp. w

[HACKERS] Distclean does not remove gram.c

2010-05-26 Thread Gurjeet Singh
The src/backend/parser/gram.c is a generated file, so shouldn't this be removed by `make distclean`, or maybe even by `make clean`? I did a `git clean -f -d` and even that did not remove gram.c, apparently because this file _was_ alive at some point in the past hence git won't remove it even thoug

Re: [HACKERS] Distclean does not remove gram.c

2010-05-27 Thread Gurjeet Singh
On Wed, May 26, 2010 at 9:00 PM, Robert Haas wrote: > On Wed, May 26, 2010 at 8:20 PM, Andrew Dunstan > wrote: > > Gurjeet Singh wrote: > >> > >> I did a `git clean -f -d` and even that did not remove gram.c, > apparently > >> because this file _was_

Re: [HACKERS] extensible enum types

2010-06-19 Thread Gurjeet Singh
On Fri, Jun 18, 2010 at 12:59 PM, Andrew Dunstan wrote: > > > David E. Wheeler wrote: > >> On Jun 18, 2010, at 9:34 AM, Andrew Dunstan wrote: >> >> >> >>> I'd be perfectly happy to hear a reasonable alternative. Assuming we use >>> some integer representation, given two labels represented by n and

<    1   2   3   4   5   >