Re: [HACKERS] USE_PGXS contrib build is broken

2013-02-04 Thread Gurjeet Singh
On Mon, Feb 4, 2013 at 3:37 PM, Alvaro Herrera wrote: > Gurjeet Singh wrote: > > On Mon, Feb 4, 2013 at 2:38 PM, Alvaro Herrera >wrote: > > > > > I just noticed that contrib programs don't build in USE_PGXS=1 > > > environment: > > > >

Re: [HACKERS] USE_PGXS contrib build is broken

2013-02-04 Thread Gurjeet Singh
On Mon, Feb 4, 2013 at 2:38 PM, Alvaro Herrera wrote: > I just noticed that contrib programs don't build in USE_PGXS=1 > environment: > > $ pwd > /pgsql/build/HEAD/contrib/pg_upgrade > $ LC_ALL=C USE_PGXS=1 make > make: *** No rule to make target `check.o', needed by `pg_upgrade'. Stop. > FWIW,

Re: [HACKERS] [PERFORM] pgbench to the MAXINT

2013-01-28 Thread Gurjeet Singh
On Sat, Jan 26, 2013 at 11:24 PM, Satoshi Nagayasu wrote: > Hi, > > I have reviewed this patch. > > https://commitfest.postgresql.org/action/patch_view?id=1068 > > 2012/12/21 Gurjeet Singh : > > The patch is very much what you had posted, except for a couple of >

Re: [HACKERS] pg_dump transaction's read-only mode

2013-01-16 Thread Gurjeet Singh
On Wed, Jan 16, 2013 at 1:21 AM, Pavan Deolasee wrote: > > > On Wed, Jan 9, 2013 at 6:42 AM, Gurjeet Singh wrote: > >> >>> >> I have updated the commitfest submission to link to the correct patch >> email. >> >> > Thanks Gurjeet. > > &

Re: [HACKERS] count(*) of zero rows returns 1

2013-01-14 Thread Gurjeet Singh
On Mon, Jan 14, 2013 at 11:03 PM, Alvaro Herrera wrote: > Gurjeet Singh escribió: > > > Interesting to note that SELECT * FROM table_with_zero_cols does not > > complain of anything. > > > > postgres=# select * from test1; > > -- > > (0 rows) > &g

Re: [HACKERS] Patches for TODO item: Avoid truncating empty OCDR temp tables on COMMIT

2013-01-14 Thread Gurjeet Singh
On Mon, Jan 14, 2013 at 10:33 PM, Tom Lane wrote: > Gurjeet Singh writes: > > Please find attached two patches, implementing two different approaches > to > > fix the issue of COMMIT truncating empty TEMP tables that have the ON > > COMMIT DELETE ROWS attribute. >

Re: [HACKERS] count(*) of zero rows returns 1

2013-01-14 Thread Gurjeet Singh
; > 1. It's not legal (the SQL spec's answer). > 2. It implicitly means a table of no columns and 1 row (PG's answer). > 3. It implicitly means a table of no columns and 0 rows (which is what >I take Gurjeet to be advocating for). > I wasn't advocating it, but was trying to wrap my head around why Postgres would do something like count(*) of nothing == 1. -- Gurjeet Singh http://gurjeet.singh.im/

Re: [HACKERS] count(*) of zero rows returns 1

2013-01-14 Thread Gurjeet Singh
On Mon, Jan 14, 2013 at 3:09 PM, David Johnston wrote: > What does "SELECT * FROM dual" in Oracle yield? > AFAICR, 'dual' table has one column named 'DUMMY' and one row with value, single character X. -- Gurjeet Singh http://gurjeet.singh.im/

Re: [HACKERS] count(*) of zero rows returns 1

2013-01-13 Thread Gurjeet Singh
On Sun, Jan 13, 2013 at 4:43 PM, Tom Lane wrote: > Gurjeet Singh writes: > > Can somebody explain why a standalone count(*) returns 1? > > postgres=# select count(*); > > count > > --- > > 1 > > (1 row) > > The Oracle equivalent of that wo

[HACKERS] count(*) of zero rows returns 1

2013-01-13 Thread Gurjeet Singh
Can somebody explain why a standalone count(*) returns 1? postgres=# select count(*); count --- 1 (1 row) I agree it's an odd thing for someone to query, but I feel it should return 0, and not 1. -- Gurjeet Singh http://gurjeet.singh.im/

Re: [HACKERS] pg_dump transaction's read-only mode

2013-01-08 Thread Gurjeet Singh
error out because of a conflict. But the following line in the docs [1] confirms otherwise: "read-only transactions will never have serialization conflicts" So no doc patch necessary :) [1] http://www.postgresql.org/docs/9.2/static/transaction-iso.html -- Gurjeet Singh http://gurjeet.singh.im/

Re: [HACKERS] [PERFORM] pgbench to the MAXINT

2012-12-20 Thread Gurjeet Singh
900 GB of disk space. Linux 3.2.6-3.fc16.ppc64 #1 SMP Fri Feb 17 21:41:20 UTC 2012 ppc64 ppc64 ppc64 GNU/Linux Best regards, PS: The primary source of patch is this branch: https://github.com/gurjeet/postgres/tree/64bit_pgbench -- Gurjeet Singh http://gurjeet.singh.im/ pgbe

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

[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] Correction to comment regarding atomicity of an operation

2012-09-12 Thread Gurjeet Singh
On Wed, Sep 12, 2012 at 4:08 PM, Noah Misch wrote: > On Wed, Sep 12, 2012 at 06:44:37AM -0400, Gurjeet Singh wrote: > > Thinking a bit more about the need for locks, I guess even the shared > > variables whose read/write ops are considered atomic need to be protected > >

Re: [HACKERS] Correction to comment regarding atomicity of an operation

2012-09-12 Thread Gurjeet Singh
On Tue, Sep 11, 2012 at 11:19 PM, Amit Kapila wrote: > On Wednesday, September 12, 2012 5:33 AM Gurjeet Singh wrote: > > ** ** > > ** ** > > > This comment in UpdateFullPageWrites() seems to be inaccurate: > > > * It's safe to check the sh

[HACKERS] Correction to comment regarding atomicity of an operation

2012-09-11 Thread Gurjeet Singh
think the real reason is that we assume that read/write to an integer is atomic, like we do for TransactionId variables: heapam.c: "TransactionId read/write is assumed atomic anyway." Best regards, PS: As usual, I hope I am not missing something very obvious. -- Gurjeet Singh http://gurjeet.singh.im/

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

2012-09-10 Thread Gurjeet Singh
On Mon, Sep 10, 2012 at 11:43 AM, Heikki Linnakangas wrote: > On 10.09.2012 18:12, Gurjeet Singh wrote: > >> On Sun, Sep 2, 2012 at 8:23 PM, Tom Lane wrote: >> >> Notably, while the lack of any background processes is just what you want >>> for pg_upgrade a

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

2012-09-10 Thread Gurjeet Singh
he first application disconnects (and hence shuts down the DB) before the second one can successfully connect. I haven't thought much about the security implications of this yet. Maybe the socket permissions would restrict an unauthorized user user from connecting to this instance. -- Gurjeet Singh http://gurjeet.singh.im/

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

2012-09-07 Thread Gurjeet Singh
it's worth stating that this has a HUGE potential > audience, and if we can get to this the deployment of Postgres could > mushroom enormously. I'm really quite excited about it. > /me shares the feeling :) -- Gurjeet Singh

[HACKERS] Report proper GUC parameter names in error messages

2012-09-05 Thread Gurjeet Singh
Error messages when terminating xlog redo leads the user to believe that there are parameters named max_prepared_xacts and max_locks_per_xact, which is not true. This patch corrects the parameter names emitted in the logs. Best regards, -- Gurjeet Singh proper_GUC_names.patch Description

Re: [HACKERS] pg_upgrade test mods for Windows/Mingw

2012-09-02 Thread Gurjeet Singh
tching in the first snippet? The Wikipedia [1] article suggests so. [1] http://en.wikipedia.org/wiki/Uname Best regards, -- Gurjeet Singh

Re: [HACKERS] PATCH: psql boolean display

2012-08-20 Thread Gurjeet Singh
n get lost on long rows that get wrapped around on screen. Writing long-winded CASE expressions to get the effect is too much for small ad-hoc queries. I thought of inventing a data type whose out-function would emit these strings, and tack a ::mybool to the expression I want modified. But that would break the applications if somebody pasted the same query in an application (JDBC or some such that understands boolean) and expected a boolean data type instead of a text output of an expression. I think there's a merit to psql supporting this feature, because psql is most commonly used for ad-hoc interactive use, and true/false is more human consumable than t/f (I have had a Java developer ask me what was that 't' value in the resultset in psql). -- Gurjeet Singh

Re: [HACKERS] pg_prewarm

2012-08-15 Thread Gurjeet Singh
ve crashed Linux with Fincore > > in the recent past). > > fincore is another soft, please provide a bugreport if you hit issue with > pgfincore, I then be able to fix it and all can benefit. > > -- > Cédric Villemain +33 (0)6 20 30 22 52 > http://2ndQuadrant.fr/ > PostgreSQL: Support 24x7 - Développement, Expertise et Formation > -- Gurjeet Singh

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] 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] 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] 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: 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

[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: [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,

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] 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] 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] 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
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] 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] 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

[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] xlog location arithmetic

2012-01-14 Thread Gurjeet Singh
on where people can upload/attach the patch, and the app posts the patch to -hackers and uses the post URL to create the CF entry. Regards, -- Gurjeet Singh EnterpriseDB Corporation The Enterprise PostgreSQL Company

Re: [HACKERS] Avoiding repeated snapshot computation

2011-11-28 Thread Gurjeet Singh
103372.6594861650.2490991.6223063263 101973.651318103330.1576121356.5062941.3302517626 102056.440561103313.8338211257.39326 1.2320567454 That looks like a win to me too. We're getting a little over 1% improvement for free! Maybe submitting this patch to the commitfest might help get some serious consideration from a reviewer. Regards, -- Gurjeet Singh EnterpriseDB Corporation The Enterprise PostgreSQL Company

Re: [HACKERS] psql line number reporting from stdin

2011-11-28 Thread Gurjeet Singh
On Mon, Nov 28, 2011 at 8:55 AM, Robert Haas wrote: > On Mon, Nov 28, 2011 at 8:49 AM, Gurjeet Singh > wrote: > > Naysayers can always make a case > Should've added that I'm not one of them :) +1 from me on the improvement. > for backwards-compatibility, or

Re: [HACKERS] psql line number reporting from stdin

2011-11-28 Thread Gurjeet Singh
ysayers can always make a case for backwards-compatibility, or not breaking the scripts written with the existing behaviour in mind. Do our docs have anything to say about scripts executed from stdin? -- Gurjeet Singh EnterpriseDB Corporation The Enterprise PostgreSQL Company

Re: [HACKERS] Unreproducible bug in snapshot import code

2011-10-28 Thread Gurjeet Singh
On Fri, Oct 28, 2011 at 10:11 AM, Bruce Momjian wrote: > Gurjeet Singh wrote: > > > > I have tried reproducing the bug starting from 1 and 2 transactions > > > before > > > > the one shown in snippet, and I used tab-completion to get the same > > >

Re: [HACKERS] Unreproducible bug in snapshot import code

2011-10-25 Thread Gurjeet Singh
On Tue, Oct 25, 2011 at 2:33 AM, Fujii Masao wrote: > On Tue, Oct 25, 2011 at 2:41 AM, Gurjeet Singh > wrote: > > On Mon, Oct 24, 2011 at 1:08 PM, Alvaro Herrera < > alvhe...@commandprompt.com> > > wrote: > >> > >> Excerpts from Gurjeet Sing

Re: [HACKERS] Unreproducible bug in snapshot import code

2011-10-24 Thread Gurjeet Singh
before the one shown in snippet, and I used tab-completion to get the same screen-output as termonal1.txt and yet it's not reproducible. Regards, -- Gurjeet Singh EnterpriseDB Corporation The Enterprise PostgreSQL Company

[HACKERS] Unreproducible bug in snapshot import code

2011-10-24 Thread Gurjeet Singh
gly linked with previously compiled .o files. Regards, -- Gurjeet Singh EnterpriseDB Corporation The Enterprise PostgreSQL Company psql (9.2devel) Type "help" for help. postgres=# begin transaction; BEGIN postgres=# set iso postgres=# set trans transaction transaction_deferrab

Re: [HACKERS] SET variable - Permission issues

2011-10-10 Thread Gurjeet Singh
VAL OF work_mem TO '1 MB'; and extend it to say ALTER USER novice SET MIN_VAL OF statement_timeout TO '1'; -- So that the user cannot turn off the timeout ALTER DATABASE super_reliable SET ENUM_VALS OF synchronous_commit TO 'on'; -- So that the user cannot change the sync

Re: [HACKERS] SET variable - Permission issues

2011-10-10 Thread Gurjeet Singh
of work_mem) to bypass a policy set by the DBA and are capable of bringing the DB down to its knees. Regards, -- Gurjeet Singh EnterpriseDB Corporation The Enterprise PostgreSQL Company

Re: [HACKERS] Removing savepointLevel from TransactionState

2011-09-29 Thread Gurjeet Singh
On Thu, Sep 29, 2011 at 8:10 AM, Alvaro Herrera wrote: > > Excerpts from Tom Lane's message of jue sep 29 02:11:52 -0300 2011: > > Gurjeet Singh writes: > > > I noticed that the savepointLevel member of TransactionStateData struct > is > > > initialized

Re: [HACKERS] Removing savepointLevel from TransactionState

2011-09-28 Thread Gurjeet Singh
On Thu, Sep 29, 2011 at 1:11 AM, Tom Lane wrote: > Gurjeet Singh writes: > > I noticed that the savepointLevel member of TransactionStateData struct > is > > initialized to 0 from TopTransactionStateData, and never incremented or > > decremented afterwards. > >

[HACKERS] Removing savepointLevel from TransactionState

2011-09-28 Thread Gurjeet Singh
commits where this variable was introduced/used/changed and could not find any point in history where it was ever useful. Maybe I missed something, but looks like it is a leftover from someone's forward-thinking. Patch attached. Regards, -- Gurjeet Singh EnterpriseDB Corporation The Enter

Re: [HACKERS] feature request: auto savepoint for interactive psql when in transaction.

2011-09-28 Thread Gurjeet Singh
+1 I would like it to be on/interactive by default, though. -- Gurjeet Singh EnterpriseDB Corporation The Enterprise PostgreSQL Company

Re: [HACKERS] feature request: auto savepoint for interactive psql when in transaction.

2011-09-28 Thread Gurjeet Singh
back to that savepoint, else release that savepoint. Regards, -- Gurjeet Singh EnterpriseDB Corporation The Enterprise PostgreSQL Company

Re: [HACKERS] memory barriers (was: Yes, WaitLatch is vulnerable to weak-memory-ordering bugs)

2011-09-21 Thread Gurjeet Singh
en and use it, but it is not defined anywhere. Wouldn't that be a linker error? -- Gurjeet Singh EnterpriseDB Corporation The Enterprise PostgreSQL Company

Re: [HACKERS] Inserting heap tuples in bulk in COPY

2011-08-12 Thread Gurjeet Singh
ange that to "fall back to old ways if there are any FOR EACH ROW triggers", since FOR EACH STATEMENT triggers won't be bothered by this optimization. -- Gurjeet Singh EnterpriseDB Corporation The Enterprise PostgreSQL Company

Re: [HACKERS] A few user-level questions on Streaming Replication and pg_upgrade

2011-07-20 Thread Gurjeet Singh
On Tue, Jul 19, 2011 at 8:45 PM, Bruce Momjian wrote: > Gurjeet Singh wrote: > > [ CC to general removed --- emailing only hackers; cross-posting is > frowned upon. ] > I thought these questions were of interest to the general public too. > > > .) Is Streaming Repl

[HACKERS] A few user-level questions on Streaming Replication and pg_upgrade

2011-07-19 Thread Gurjeet Singh
hough the project will try hard to avoid having to make any changes that may affect in-place upgrade capability, but if a case can be made that a feature would give a significant improvement at the cost of compromising this capability, then the in-place upgrade capability may be forgone for that rele

Re: [HACKERS] Launching debugger on self on SIGSEGV

2011-07-11 Thread Gurjeet Singh
On Mon, Jul 11, 2011 at 12:56 PM, Tom Lane wrote: > Gurjeet Singh writes: > > The attached patch registers a signal handler for SIGSEGV and > launches > > GDB in batch mode on its own pid so that the stack leading to the SEGV > can > > be dumped in the server log

[HACKERS] Launching debugger on self on SIGSEGV

2011-07-11 Thread Gurjeet Singh
do is create an external process with certain parameters, and CreateProcess() is all we need. I haven't investigated seriously about that but of there's interest in this patch then I can spend some time on that too. Regards, -- Gurjeet Singh EnterpriseDB Corporation The Enterprise PostgreS

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] 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] 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] 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] 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
. 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] 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] 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] 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-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-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-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] 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 > >

[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] 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] 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] 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] 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] 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] 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

[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] 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

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
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-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

[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] 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

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-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-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-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 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 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 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-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

[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

[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

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

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-25 Thread Gurjeet Singh
Sorry for not being on top of this. On Tue, Jan 25, 2011 at 9:01 AM, Tom Lane wrote: > I wrote: > > ... If that's the only issue then I don't see any need to wait on > > the author, so will take this one. > > I find myself quite dissatisfied with the way that this patch adds yet > another bool f

<    1   2   3   4   5   >