Re: [GENERAL] a JOIN on same table, but 'slided over'

2007-06-26 Thread Gurjeet Singh
Hi Rafal, Just a note that this is not standard SQL... 'distinct on' is an extension to SQL provided by postgres. Following query utilizes the standard SQL to get the same results: selectt1.id as id, t2.id as "id+1", t1.thread as thread, t2.thread as "thread+1", t1.info as

Re: [GENERAL] a JOIN on same table, but 'slided over'

2007-06-26 Thread Gurjeet Singh
[EMAIL PROTECTED] gmail | hotmail | indiatimes | yahoo }.com 17°29'34.37"N 78°30'59.76"E - Hyderabad * 18°32'57.25"N 73°56'25.42"E - Pune Sent from my BlackLaptop device On 6/26/07, Gurjeet Singh <[EMAIL PROTECTED]> wrote: Hi Rafal, Just a

Re: [GENERAL] a JOIN on same table, but 'slided over'

2007-06-26 Thread Gurjeet Singh
On 6/26/07, Tom Lane <[EMAIL PROTECTED]> wrote: "news.gmane.org" <[EMAIL PROTECTED]> writes: > Gurjeet Singh skrev: >> Also note that this query is much cheaper that the 'distinct on' query >> by more than two orders on magnitude ( 217.86 vs.

Re: [GENERAL] a JOIN on same table, but 'slided over'

2007-06-28 Thread Gurjeet Singh
On 6/28/07, Alban Hertroys <[EMAIL PROTECTED]> wrote: This is called a 'correlated subquery'. Basically the subquery is performed for each record in the top query. Google gave me this: http://publib.boulder.ibm.com/infocenter/iseries/v5r3/index.jsp?topic=/sqlp/rbafycorrs.htm I think the su

Re: [GENERAL] a JOIN on same table, but 'slided over'

2007-06-29 Thread Gurjeet Singh
cut away the details from EXPLAIN output): ---STANDARD Total runtime: 10.660 ms ---DISTINCT-ON Total runtime: 1.479 ms --- Would there be ways to optimise the standard query to get the performance closer to the none-standard one? -R On Tue, 2007-06-26 at 18:05 +0530,

Re: [GENERAL] Dump/Restore Large Object OID

2007-12-01 Thread Gurjeet Singh
Why not give it a try once? Dump and restore once and see for yourself. You'd have done that by now, but if you haven't do give it a try instead of waiting any more. You may learn a thing or two in the process... Best regards, -- [EMAIL PROTECTED] [EMAIL PROTECTED] gmail | hotmail | indiatimes |

Re: [GENERAL] Initdb problem - catch 22?

2007-12-19 Thread Gurjeet Singh
You should run the commands in the following order: initdb pg_ctl -D -w start # (recommended way of starting the the server) createdb #(optional, since default DB postgres is already there) On Dec 19, 2007 6:17 AM, Glyn Astill <[EMAIL PROTECTED]> wrote: > Hi peop

Re: [GENERAL] Warm standby system - FATAL: the database system is starting up

2007-12-21 Thread Gurjeet Singh
I would recommend that whenever you are trying to recover a database (be it WAL shipping or any other method), first change the port it is listening on, to something that your apps wouldn't assume the DB to be running on, and then start the recovery. This way, even if there's a rogue application t

Re: [GENERAL] how to alter an enum type

2007-12-25 Thread Gurjeet Singh
Here's a possible solution (this may take long time if the table is too big). The trick is to add a new column with a newly defined datatype, that picks up values from the old column. Here's the sample psql script (the session output follows after that): create type possible_answers as enum ( 'yes

Re: [GENERAL] how to alter an enum type

2007-12-26 Thread Gurjeet Singh
ally would like to be able to alter the enum type > on the fly, so instead of using enum, I think I'll just use a "smallint" > type and tie the "possible results" to the application using flags such > as 0, 1, 2, 3 and whatever.. I think it will be easier for me

[GENERAL] ERROR during WAL replay

2008-01-12 Thread Gurjeet Singh
Hi All, We were trying to move a big database from one machine to the other using PITR mechanism. We hit the following LOG message in during the recovery (WAL replay) process" LOG: incorrect resource manager data checksum in record at 111/A7738C8 I had used this procedure to do such mig

Re: [GENERAL] Forgot to dump old data before re-installing machine

2008-01-14 Thread Gurjeet Singh
And also remember to use the same version of Postgres as the previous installation... It might be helpful to post the tail of your server's log ahen it fails. Best Regards, On Jan 14, 2008 7:58 AM, Tom Lane <[EMAIL PROTECTED]> wrote: > Stefan Schwarzer <[EMAIL PROTECTED]> writes: > > I re-insta

Re: [GENERAL] The first dedicated PostgreSQL forum

2010-11-22 Thread Gurjeet Singh
On Fri, Nov 19, 2010 at 1:07 AM, Thom Brown wrote: > > As has been said previously, an unlinked forum (one which has no > interaction with the mailing list) is destined to fail, as others have > in the past. It's creates a fragmented community and poor support on > such a forum would reflect bad

Re: [GENERAL] Do we want SYNONYMS?

2010-12-07 Thread Gurjeet Singh
On Tue, Dec 7, 2010 at 1:54 PM, Pavel Stehule wrote: > Hello > > 2010/12/7 Joshua D. Drake : > > Your perception has been mirrored on the Oracle free list. Really what > > PostgreSQL people need to come to grips with is whether or not we want > > to make it easier for others to port to Pg or not.

Re: [GENERAL] did freese in creating a database cluster

2010-12-27 Thread Gurjeet Singh
On Mon, Dec 27, 2010 at 11:05 PM, Fujii Masao wrote: > On Tue, Dec 28, 2010 at 11:21 AM, Tsutomu Nakajima > wrote: > > I add the information of freeze status in creating a database cluster. > > The info is that the following process exists. > > > > postgres 1331432 708812 0 11:08:31 pts/10 0

Re: [GENERAL] Devart ADO.NET Data Providers Deliver Advanced Model-First and Database-First Support and Improved ORM Solution!

2010-12-28 Thread Gurjeet Singh
I think this is not the right forum for such announcements. Consider http://archives.postgresql.org/pgsql-announce/ . I think Postgres weekly news will pick it up automatically from there. Regards, On Tue, Dec 28, 2010 at 8:45 AM, Devart wrote: > > New versions of Devart ADO.NET Data Providers

Re: [GENERAL] Restore problem

2010-12-28 Thread Gurjeet Singh
On Tue, Dec 28, 2010 at 6:06 PM, Bob Pawley wrote: > Hi > > I have restored a database using psql to windows version 8.4. > > During the restore the trigger code became jumbled. > > I now have a great number of lines that have moved so that they are now > included in lines the have been commen

Re: [GENERAL] Cursors WITH HOLD

2011-01-03 Thread Gurjeet Singh
2010/12/30 pasman pasmański > Hello. > > I use Postgres 8.4.5 via perl DBI. > And i try to use cursors WITH HOLD to materialize > often used queries. > > My question is how many cursors may be > declared per session and which memory setting s > to adjust for them ? > I believe there's no maximum

Re: [GENERAL] Huge spikes in number of connections doing "PARSE"

2011-03-11 Thread Gurjeet Singh
l-dependent, so it's hard to make categorical guarantees of safety. At least on Windows NT and derivatives (until I last checked a few years ago), detaching a debugger kills the debugged process. Regards, -- Gurjeet Singh EnterpriseDB <http://www.enterprisedb.com/> Corp

Re: [GENERAL] How do you stop the log from rotating on restart?

2011-03-20 Thread Gurjeet Singh
ust want it to rotate once a day no matter haw many times we restart. > > Don't see anything else that would seem to affect log file rotation > You'll have to play with the format in log_filename GUC. HTH, -- Gurjeet Singh EnterpriseDB <http://www.enterpri

Re: [GENERAL] stack depth limit exceeded

2011-03-31 Thread Gurjeet Singh
nstraint WHERE oid in (SELECT objid FROM > pg_catalog.pg_depend > WHERE refobjid = $1::regclass::oid AND deptype ='n') > > LOOP > > RETURN NEXT node.relname; > FOR child_node IN SELECT * FROM dependon(node.relname) > LOO

Re: [GENERAL] Options for passing values to triggers?

2013-02-04 Thread Gurjeet Singh
On Mon, Feb 4, 2013 at 2:01 PM, wrote: > Hello. > > I'm modelling a system where I'd like to log inserts and deletes > to two or more tables (with foreign key references between them). > > As a (contrived) example: > > CREATE TABLE projects ( > project_id SERIAL PRIMARY KEY, > project_name

[GENERAL] Re: [HACKERS] function for setting/getting same timestamp during whole transaction

2013-02-06 Thread Gurjeet Singh
nfig(my_var.now, now()) set_config(my_var.my_ts, clock_timestamp) end; -- Go on happily use my_var.my_ts to stamp your data. HTH, -- Gurjeet Singh http://gurjeet.singh.im/

Re: [GENERAL] Function returning subset of columns from table (return type)

2008-02-03 Thread Gurjeet Singh
On Feb 3, 2008 3:23 PM, brian <[EMAIL PROTECTED]> wrote: > CREATE TYPE your_type > AS ( > added CHAR(11) NOT NULL, > updated CHAR(11) NOT NULL, > text_col TEXT > ); > > CREATE FUNCTION get_note(id INT) > RETURNS SETOF your_type IMMUTABLE > AS $$ > > DECLARE > your_row your_type%rowtype

[GENERAL] Reverse key index

2008-02-03 Thread Gurjeet Singh
Hi All, I have wanted to create a reverse key index for some time now, and it seems that an evening of reading and half a day of efforts finally paid off. This is just a proof of concept, and sure, the bit-reversing technique can use a native language's power for better results. I started

Re: [GENERAL] Reload only specific databases from pg_dumpall

2008-02-04 Thread Gurjeet Singh
What was the output format option used (-f option) ? Was it the plain-text (SQL) or custom format? Best regards On Feb 4, 2008 2:45 AM, Guido Neitzer <[EMAIL PROTECTED]> wrote: > Hi. > > Is it possible to reload only specific databases from a file created > by pg_dumpall? > > Thanks, > cug > > -

Re: [GENERAL] Reload only specific databases from pg_dumpall

2008-02-04 Thread Gurjeet Singh
" count --- 100 (1 row) HTH, Best regards, On Feb 4, 2008 10:54 AM, Guido Neitzer <[EMAIL PROTECTED]> wrote: > On 04.02.2008, at 10:41, Gurjeet Singh wrote: > > > What was the output format option used (-f option) ? Was it the > > plain-text (SQL) or custom format? &g

Re: [GENERAL] Reload only specific databases from pg_dumpall

2008-02-04 Thread Gurjeet Singh
I understand it all needs a little bit of 'vi' wizardry, (or whichever editor you are using). Also, as with all open-source suggestions, do not rely on this procedure until you understand what and how it does what it does. Best regards, On Feb 4, 2008 4:39 PM, Gurjeet Singh <[EM

Re: [GENERAL] Reload only specific databases from pg_dumpall

2008-02-04 Thread Gurjeet Singh
ional step look smaller than the time required to restore+drop unwanted DBs. Best regards, On Feb 4, 2008 5:10 PM, Guido Neitzer <[EMAIL PROTECTED]> wrote: > On 04.02.2008, at 18:00, Gurjeet Singh wrote: > > > I understand it all needs a little bit of 'vi' wizardry,

Re: [GENERAL] Reload only specific databases from pg_dumpall

2008-02-04 Thread Gurjeet Singh
03 PM, Scott Marlowe <[EMAIL PROTECTED]> wrote: > On Feb 4, 2008 7:10 PM, Guido Neitzer <[EMAIL PROTECTED]> wrote: > > On 04.02.2008, at 18:00, Gurjeet Singh wrote: > > > > > I understand it all needs a little bit of 'vi' wizardry, (or > > > wh

Re: [GENERAL] pg_restore seems slow

2008-02-09 Thread Gurjeet Singh
On Feb 9, 2008 10:42 AM, Willem Buitendyk <[EMAIL PROTECTED]> wrote: > I'm trying to restore my database from 8.26 into 8.3 (win32) but find > the process to be exceedingly slow. The database has about 60M records. > I realize there will be differences based on hardware, available memory, > compl

Re: [GENERAL] LIMIT Question

2008-02-29 Thread Gurjeet Singh
In my opinion (without looking at the code), if you have a grouping-function or ORDER BY or GROUP BY clause, then yes, the whole query has to be executed to show the first row of the result-set. But if the query doesn't have any of these clauses, then the DB has the ability to send back the first r

Re: [GENERAL] LIMIT Question

2008-02-29 Thread Gurjeet Singh
On Fri, Feb 29, 2008 at 3:55 PM, Martijn van Oosterhout <[EMAIL PROTECTED]> wrote: > On Fri, Feb 29, 2008 at 02:53:05PM +0530, Gurjeet Singh wrote: > > In my opinion (without looking at the code), if you have a > grouping-function > > or ORDER BY or GROUP BY clause, then

Re: [GENERAL] LIMIT Question

2008-02-29 Thread Gurjeet Singh
On Fri, Feb 29, 2008 at 7:20 PM, Sam Mason <[EMAIL PROTECTED]> wrote: > On Fri, Feb 29, 2008 at 05:28:29PM +0530, Gurjeet Singh wrote: > > On Fri, Feb 29, 2008 at 3:55 PM, Martijn van Oosterhout < > [EMAIL PROTECTED]> wrote: > > > Except if you have an index on th

Re: [GENERAL] ISO something like "#if 0 ... #endif" for SQL code

2008-03-11 Thread Gurjeet Singh
On Mon, Mar 10, 2008 at 9:20 PM, Kynn Jones <[EMAIL PROTECTED]> wrote: > > > > Hi! When it comes to programming SQL, my newbie approach is to write my > code in a file test.sql, which I test from within psql by using > > my_db=> \i /some/path/test.sql > > ...and (once I'm satisfied with the cod

Re: [GENERAL] postgre vs MySQL

2008-03-14 Thread Gurjeet Singh
On Thu, Mar 13, 2008 at 6:06 PM, rrahul <[EMAIL PROTECTED]> wrote: > > Thanks to all you wonderful people out their. I don't know if its your > love > for Postgres or nepothism that makes it look far superior than mysql. I wouldn't comment on that, but having read so much about MySQL in Postgres

Re: [GENERAL] identify database process given client process

2008-03-18 Thread Gurjeet Singh
On Mon, Mar 17, 2008 at 8:28 PM, hogcia <[EMAIL PROTECTED]> wrote: > Hi, > I have to find a Postgres database process pid (or other > identification) for a given client process pid. Or client processes > for a database process. How are they connected? I was suggested maybe > netstat could give me

Re: [GENERAL] How to concatenate a boolean to a text string for an EXECUTE stmt in a stored proc

2008-03-23 Thread Gurjeet Singh
On Thu, Mar 20, 2008 at 1:58 AM, Keaton Adams <[EMAIL PROTECTED]> wrote: > > Postgres 8.1 on RHEL > > How do I formulate this EXECUTE statement so that cust_hold (boolean > column in the table) can be set to the value in v_cust_on_hold (boolean > variable in a function)? > > v_cust_on_hold BO

Re: [GENERAL] Can Postgres 8.x start if some disks containing tablespaces are not mounted?

2008-03-31 Thread Gurjeet Singh
On Mon, Mar 31, 2008 at 11:40 PM, Tom Lane <[EMAIL PROTECTED]> wrote: > "Morris Goldstein" <[EMAIL PROTECTED]> writes: > > Suppose I have a database with $PGDATA on /dev/sda, and a tablespace > > directory on /dev/sdb. Will Postgres start successfully if /dev/sda is > > mounted and /dev/sdb is not

Re: [GENERAL] Can Postgres 8.x start if some disks containing tablespaces are not mounted?

2008-04-01 Thread Gurjeet Singh
On Tue, Apr 1, 2008 at 7:42 PM, Morris Goldstein < [EMAIL PROTECTED]> wrote: > But that makes me wonder: what about this sequence of events: > > - Postgres running normally on /dev/sda and /dev/sdb. > - Update to table in /dev/sdb tablespace is committed but still exists in > WAL. > - Postgres cra

Re: [GENERAL] PostgreSQL on Vista

2008-04-21 Thread Gurjeet Singh
I would recommend creating rules in your firewall that let Postgres run and listen on sockets rather than turn off the firewall altogether. (The firewall rules _may_ not be the problem in your case, but you can still try) On an orthogonal note, I just disliked the UAC in Vista... For the first mon

Re: [GENERAL] table as log (multiple writers and readers)

2008-04-22 Thread Gurjeet Singh
On Wed, Apr 23, 2008 at 12:29 AM, David Wilson <[EMAIL PROTECTED]> wrote: > On Tue, Apr 22, 2008 at 2:48 PM, Joris Dobbelsteen > <[EMAIL PROTECTED]> wrote: > > > > Ah, yes, all visible rows... > > My point is that, unless you use a transaction with serializable > isolation, > > this all visible

Re: [GENERAL] How to modify ENUM datatypes?

2008-04-22 Thread Gurjeet Singh
On Tue, Apr 22, 2008 at 3:31 PM, D. Dante Lorenso <[EMAIL PROTECTED]> wrote: > All, > > In the past I have used foreign keys to lookup tables for small lists of > values that I now think ENUM could do the job of. I was hoping that by > using ENUM, I would avoid having to do joins in my queries, a

Re: [GENERAL] inheritance. more.

2008-04-28 Thread Gurjeet Singh
On Mon, Apr 28, 2008 at 8:01 PM, Erik Jones <[EMAIL PROTECTED]> wrote: > > Postgres doesn't yet handle inheritance of constraints from parent to > child tables via inheritance. > > Was it done by design or was it a limitation we couldn't get over? Best regards, -- [EMAIL PROTECTED] [EMAIL PROTEC

Re: [GENERAL] inheritance. more.

2008-04-30 Thread Gurjeet Singh
On Tue, Apr 29, 2008 at 11:47 AM, Martijn van Oosterhout <[EMAIL PROTECTED]> wrote: > On Tue, Apr 29, 2008 at 06:31:30AM +0530, Gurjeet Singh wrote: > > On Mon, Apr 28, 2008 at 8:01 PM, Erik Jones <[EMAIL PROTECTED]> wrote: > > > Postgres doesn't yet handle inh

Re: [GENERAL] ERROR: could not open relation

2008-05-07 Thread Gurjeet Singh
On Wed, May 7, 2008 at 1:50 PM, Zdenek Kotala <[EMAIL PROTECTED]> wrote: > Q Master napsal(a): > > > I get this strange error > > > > Caused by: org.postgresql.util.PSQLException: ERROR: could not open > > relation 1663/53544/58374: No such file or directory > > > > How do I recover from it ? Vers

Re: [GENERAL] Scripting function definitions as SQL?

2008-05-12 Thread Gurjeet Singh
On Mon, May 12, 2008 at 10:57 AM, Reece Hart <[EMAIL PROTECTED]> wrote: > On Sun, 2008-05-11 at 06:12 -0700, Postgres User wrote: > > Has anyone written a function that scripts out all the functions in a > > database as full SQL statements (Create Function.) > > You could pg_dump the schema in

Re: [GENERAL] Stripping out slony after / before / during pg_restore?

2008-05-13 Thread Gurjeet Singh
On Tue, May 13, 2008 at 5:42 PM, Glyn Astill <[EMAIL PROTECTED]> wrote: > Hi people, > > I'm setting us up a separate staging / test server and I want to read in a > pg_dump of our current origin stripping out all the slony stuff. > > I was thinking this could serve two purposes a) test out backup

Re: [GENERAL] pg_standby stuck on a wal file size <16MB

2008-05-17 Thread Gurjeet Singh
On Sun, May 18, 2008 at 12:17 AM, Vladimir Kosilov <[EMAIL PROTECTED]> wrote: > I've been having problem with pgsql-8.2.5 master/slave warm standby > replication setup where occasionally master node generates a wal file > smaller then expected 16MB. pg_standby on slave gets stuck on such short > f

Re: [GENERAL] pg_standby stuck on a wal file size <16MB

2008-05-17 Thread Gurjeet Singh
On Sun, May 18, 2008 at 5:48 AM, Vlad Kosilov <[EMAIL PROTECTED]> wrote: > is this wrong of me to expect that postgres would not make a wal file > available to archive_command unless it was completely ready to let go of > that wal file? > thats a perfectly reasonable expectation; and thats exactl

Re: [GENERAL] Seeking rows whit \

2008-05-18 Thread Gurjeet Singh
On Mon, May 19, 2008 at 7:56 AM, Francisco Reyes <[EMAIL PROTECTED]> wrote: > Is there a way to search for rows with the character \? > > I tried variants of like and ~. > > create table mytable (f1 text); > insert into mytable values ('Test row 1'); > insert into mytable values (E'Test row 2 \\'

Re: [GENERAL] Join three fields into one on same table

2008-05-19 Thread Gurjeet Singh
On Tue, May 20, 2008 at 5:34 AM, Sam Mason <[EMAIL PROTECTED]> wrote: > On Mon, May 19, 2008 at 03:36:39PM -0600, Scott Marlowe wrote: > > On Mon, May 19, 2008 at 4:51 AM, jrivero <[EMAIL PROTECTED]> wrote: > > > My problem is not that make update query. > > > > > >> update table set date=(select

Re: [GENERAL] pg_standby stuck on a wal file size <16MB

2008-05-20 Thread Gurjeet Singh
On Wed, May 21, 2008 at 4:14 AM, Vlad Kosilov <[EMAIL PROTECTED]> wrote: > as Greg pointed out: my use of rsync --remove-sent-files option had > contributed to a short sized wal log file on standby. > changing master's postgres crontab to the following helped to resolve the > issue: > > # ship log

Re: [GENERAL] Is this correct usage of generate_series?

2008-05-22 Thread Gurjeet Singh
On Thu, May 22, 2008 at 10:41 PM, Hiroaki Nakamura <[EMAIL PROTECTED]> wrote: > Hi, there. > > These three queries below works as I expect, which is wonderful, but are > these correct usages? > If these are intended features, I would like them to be documented at > http://www.postgresql.org/docs/8

Re: [GENERAL] syntax error with execute

2008-05-30 Thread Gurjeet Singh
On Fri, May 30, 2008 at 9:25 PM, A B <[EMAIL PROTECTED]> wrote: > I have a query like this in a plpgsql function: > > EXECUTE 'INSERT INTO '||tablename||' ('||fields||') VALUES > ('||vals||') RETURNING currval('''||seqname||''') INTO newid' > > and I get the response: > > ERROR: syntax error at o

Re: [GENERAL] does postgresql works on distributed systems?

2008-06-04 Thread Gurjeet Singh
On Wed, Jun 4, 2008 at 11:34 AM, Volkan YAZICI <[EMAIL PROTECTED]> wrote: > I'm planning to make a survey regarding PostgreSQL performance on > OpenSSI. There are some obstacles mostly caused by shared-memory > architecture of PostgreSQL, but that claim is -- AFAIK -- totally > theoratical. There

Re: [GENERAL] Annoying messages when copy sql code to psql terminal

2008-06-05 Thread Gurjeet Singh
On Fri, Jun 6, 2008 at 7:58 AM, Merlin Moncure <[EMAIL PROTECTED]> wrote: > On Tue, May 27, 2008 at 9:24 AM, A B <[EMAIL PROTECTED]> wrote: > > Whenever I use copy-paste to run code in a terminal window that is > > running psql, and the code contains a row like > > > > IF FOUND THEN > > > > then I

Re: [GENERAL] when to reindex?

2008-06-08 Thread Gurjeet Singh
On Sat, Jun 7, 2008 at 8:07 PM, Jeremy Harris <[EMAIL PROTECTED]> wrote: > Gregory Stark wrote: > >> REINDEX scans the table >> precisely once and sorts it. >> > > For the bloat, as opposed to corruption, case - > what information is needed from the table that > is not in the old index? Why woul

Re: [GENERAL] Clustering with minimal locking

2008-06-18 Thread Gurjeet Singh
On Wed, Jun 18, 2008 at 9:26 AM, Decibel! <[EMAIL PROTECTED]> wrote: > On Jun 17, 2008, at 11:37 AM, Scott Ribe wrote: > >> BOOM! Deadlock. >>> >> >> No more likely than with the current cluster command. Acquiring the lock >> is >> the same risk; but it is held for much less time. >> > > > Actuall

[GENERAL] Query to find Foreign Key column data type mismatch

2009-05-31 Thread Gurjeet Singh
Hi All, I wanted to find out if both the ends of a foreign key reference were using the same data types, since, in older versions, not having the same data types can lead to Postgres not picking the appropriate index, and in newer versions also it would be beneficial since having same data typ

Re: [GENERAL] Division by zero

2009-06-03 Thread Gurjeet Singh
On Wed, Jun 3, 2009 at 9:18 PM, Oliver Kohll - Mailing Lists < oliver.li...@gtwm.co.uk> wrote: > Hello, > > We have a system that allows users to create views containing calculations > but divisions by zero are commonly a problem. > > An simple example calculation in SQL would be > > SELECT cost /

Re: [GENERAL] Can postgresql store its data on raw device now?

2009-06-09 Thread Gurjeet Singh
It still doesn't support raw device. On Tue, Jun 9, 2009 at 1:06 PM, Lizzy M wrote: > Hello, > >I have an problem: can postgresql store its data on the raw disks > now? > >I have checked the mail list and manual, but haven’t found the > answer. In some early mails, they mentioned

Re: [GENERAL] Rounding incompatibility

2009-06-15 Thread Gurjeet Singh
On Mon, Jun 15, 2009 at 4:28 PM, Havasvölgyi Ottó < havasvolgyi.o...@gmail.com> wrote: > Hi, > > I have found the following strangeness on Windows versions: > > create table round_test (id int primary key, value double precision); > insert into round_test(id, value) values(1, 1.5); > insert into r

Re: [GENERAL] pl/sql resources for pl/pgsql?

2009-06-19 Thread Gurjeet Singh
On Sat, Jun 20, 2009 at 10:52 AM, Jasen Betts wrote: > On 2009-06-16, gvimrc wrote: > > I'm fairly new to PostgreSQL and completely new to using pl/pgsql > > though I've used MySQL's procedural language a little. > > I heard pl/pgsql is similar to Oracle's pl/sql so would it be possible, > > giv

Re: [GENERAL] Start automatically a function at startup of postgresql server

2009-07-04 Thread Gurjeet Singh
On Sat, Jul 4, 2009 at 2:21 PM, d...@dfx.it wrote: > Dear Sirs, > > Is it possible to start a function (a my function) when the > server postgres is started? and how I can do? > > No.. There's no way that can be done in Postgres. Although you can add something to your startup scripts that connect

Re: [GENERAL] Logging statements longer than 1000ms doesn't appear to work

2009-09-22 Thread Gurjeet Singh
Sometimes, your current postgresql.conf might not be in sync with server settings, for various reasons. I'd suggest looking at the output of: select name, setting, source from pg_settings where name like E'log\\_%'; Best regards, On Wed, Sep 23, 2009 at 3:13 AM, Chris Barnes < compuguruchrisbar.

Re: [GENERAL] Using complex PRIMARY KEY

2009-10-08 Thread Gurjeet Singh
2009/10/8 Zsolt > > This is our first project using PostgerSQL, where I have a problem I cant > solve on a neat way (I assume PGSQL should provide a nice solution...). > > So we have an old xBase based program we are trying to port to PostgreSQL > while we should keep the original data structure

[GENERAL] 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: [GENERAL] Primary key vs unique index

2012-07-06 Thread Gurjeet Singh
at Nabble.com. > > -- > Sent via pgsql-general mailing list (pgsql-general@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-general > -- Gurjeet Singh EnterpriseDB Corporation The Enterprise PostgreSQL Company

Re: [GENERAL] Primary key vs unique index

2012-07-06 Thread Gurjeet Singh
one command (and hence one transaction), so anything that depends this constraint should not be affected except from the fact that this table will be locked in exclusive mode for the duration of this operation, which should be very short. Best regards, -- Gurjeet Singh EnterpriseDB Corporation

Re: [GENERAL] two-column primary key (not the typical question)

2012-07-06 Thread Gurjeet Singh
ey value violates unique constraint "test3_case_idx" DETAIL: Key (( CASE WHEN a::text < b::text THEN a::text || b::text ELSE b::text || a::text END))=(barfoo) already exists. postgres=# Best regards, -- Gurjeet Singh EnterpriseDB Corporation The Enterprise PostgreSQL Company

Re: [GENERAL] Suboptimal query plan fixed by replacing OR with UNION

2012-07-06 Thread Gurjeet Singh
NION ALL operator to join the resulting queries, just like you did. Optimizer does need to add additional AND clauses to some of the branches to make sure the result set is not affected. Just a thought. -- Gurjeet Singh EnterpriseDB Corporation The Enterprise PostgreSQL Company

[GENERAL] Getting random rows from a table

2012-08-31 Thread Gurjeet Singh
.00 rows=1000 width=32) (actual time=246.101..246.714 rows=100 loops=1) Total runtime: 247.452 ms (2 rows) postgres=> -- Gurjeet Singh get_random_rows.sql Description: Binary data get_random_rows_seq.sql Description: Binary data -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Why some GUC parameter names are not lowercased

2012-10-30 Thread Gurjeet Singh
On Tue, Oct 30, 2012 at 12:11 PM, Tom Lane wrote: > Gurjeet Singh writes: > > Is there a reason why Postgres chose to not use all lowercase characters > > for these parameters' names. > > DateStyle > > IntervalStyle > > TimeZone > > It'

Re: [GENERAL] setting contrib lo visible to all schemas

2010-05-20 Thread Gurjeet Singh
On Thu, May 20, 2010 at 11:16 AM, Teddy Limousin wrote: > thanks tom, aparently your rigth in the sql dump file there are some > set search_path changes > I tried the set search_path command and use the same query that generate > the error and it works on my pgadmin editor. > > My question is how

Re: [GENERAL] 9.0RC1 error variable not found in subplantarget lists

2010-09-26 Thread Gurjeet Singh
2010/9/26 Andrus > Here's the patch if it helps. >> > > Thank you. > When 9.1 will released ? > Is it possible to remove 9.0 from downloads so that this issue will not > propagated? > > If committed, this fix will be available in 9.0.1. Thanks for the bug report and the reproducible test case.

Re: [GENERAL] 9.0RC1 error variable not found in subplantarget lists

2010-09-26 Thread Gurjeet Singh
2010/9/26 Andrus > Here's the patch if it helps. >> > > Thank you. > When 9.1 will released ? > Is it possible to remove 9.0 from downloads so that this issue will not > propagated? > > > If committed, this fix will be available in release 9.0.1. I cannot comment on when it will be available tho

Re: [GENERAL] Checking for stale reads on hot standby

2010-09-26 Thread Gurjeet Singh
On Mon, Sep 27, 2010 at 1:51 AM, Yang Zhang wrote: > Say you have an application using PG asynchronous streaming > replication to some hot standbys, to distribute the read load. The > application itself is a typical web application consisting of multiple > servers, serving a number of sessions (p

Re: [GENERAL] Preserving order through an inner join

2010-09-27 Thread Gurjeet Singh
On Sun, Sep 26, 2010 at 9:37 PM, Tom Lane wrote: > > The SQL standard explicitly disavows any particular > output row order unless there is a top-level ORDER BY. (In fact, > unless things have changed recently an ORDER BY in a sub-select isn't > even legal per spec.) > > Not sure about the SQL s

Re: [GENERAL] Copying a column into a temp. table

2010-10-01 Thread Gurjeet Singh
On Fri, Oct 1, 2010 at 10:02 AM, Adrian Klaver wrote: > On Friday 01 October 2010 6:54:09 am Alexander Farber wrote: > > How do you copy a column from table please? > > I'm trying with PostgreSQL 8.1.21/CentOS 5.5: > > > select topic_id from phpbb_topics where forum_id=5 and topic_poster=1 > > a

Re: [GENERAL] Copying a column into a temp. table

2010-10-01 Thread Gurjeet Singh
On Fri, Oct 1, 2010 at 10:52 AM, Alexander Farber < alexander.far...@gmail.com> wrote: > Thank you, I've created the following script which seems to work ok. > > I just hope, that it won't be hit by the max_stack_depth-problem > which actually forced me to look for a custom solution - > >SQL E

Re: [GENERAL] error while autovacuuming

2010-10-03 Thread Gurjeet Singh
On Fri, Oct 1, 2010 at 9:16 PM, Craig Ringer wrote: > On 2/10/2010 5:44 AM, Scott Marlowe wrote: > >> On Fri, Oct 1, 2010 at 2:06 PM, tamanna madaan >> wrote: >> >>> Hi All >>> >>> I am planning to upgrade postgres to avoid this autovacuum problem. >>> >>> From the release notes of postgres-8.

[GENERAL] Confusion about ident sameuser

2008-07-02 Thread Gurjeet Singh
Hi All, I am confused with the 'ident sameuser' authentication. Here's my setup: [EMAIL PROTECTED] ~]$ grep -v "^#" /pg_hba.conf local all all ident sameuser hostall all 127.0.0.1/32 ident sameuser hostall all

Re: [GENERAL] Index question regarding numeric operators

2008-10-01 Thread Gurjeet Singh
On Wed, Oct 1, 2008 at 1:57 PM, Mike Christensen <[EMAIL PROTECTED]> wrote: > Hi guys, I'm very new to PostgreSQL so please excuse me if this is an easy > question.. > > I have a table called Recipes which has a column called CookTime. I have > an index on the CookTime column as such: > > CREATE

Re: [GENERAL] Transactions within a function body

2008-10-02 Thread Gurjeet Singh
On Thu, Oct 2, 2008 at 8:40 PM, Alvaro Herrera <[EMAIL PROTECTED]>wrote: > Reg Me Please escribió: > > Il Thursday 02 October 2008 16:15:10 Alvaro Herrera ha scritto: > > > > You can nest blocks arbitrarily, giving you the chance to selectively > > > rollback pieces of the function. It's only a b

Re: [GENERAL] Transactions within a function body

2008-10-02 Thread Gurjeet Singh
No, in Oracle too SAVEPOINT and AUTONOMOUS transaction are different beasts. On Thu, Oct 2, 2008 at 9:27 PM, Bob Henkel <[EMAIL PROTECTED]> wrote: > Coming from an Oracle background my understanding is they're one in the > same. > > > > > On Thu, Oct 2, 2008 at 10:37 AM, Alvaro Herrera < > [EMAIL

Re: [GENERAL] How do I save data and then raise an exception?

2008-10-02 Thread Gurjeet Singh
On Fri, Oct 3, 2008 at 7:41 AM, Jaime Casanova <[EMAIL PROTECTED] > wrote: > On Thu, Oct 2, 2008 at 8:44 PM, Alvaro Herrera > <[EMAIL PROTECTED]> wrote: > > Rob Richardson wrote: > > > >> Here's what I need to do: > >> > >> IF query_check_fails THEN > >> UPDATE some_table SET some_value = 0 WH

Re: [GENERAL] How do I save data and then raise an exception?

2008-10-02 Thread Gurjeet Singh
On Fri, Oct 3, 2008 at 7:14 AM, Alvaro Herrera <[EMAIL PROTECTED]>wrote: > Rob Richardson wrote: > > > Here's what I need to do: > > > > IF query_check_fails THEN > > UPDATE some_table SET some_value = 0 WHERE some_condition_is_true; > > RAISE EXCEPTION 'Look, you idiot, do it right next t

Re: [GENERAL] Getting rows in statement-level triggers

2008-10-02 Thread Gurjeet Singh
On Fri, Oct 3, 2008 at 11:42 AM, Artacus <[EMAIL PROTECTED]> wrote: > > So the manual says there is no way for a statement-level trigger to >> examine the row(s) modified by the statement. >> >> Is there any way to get the xmin or cmin of the transaction that fired the >> trigger? Or can I look u

Re: [GENERAL] failed to install posgrest

2008-10-03 Thread Gurjeet Singh
On Sat, Oct 4, 2008 at 2:42 AM, Dave Page <[EMAIL PROTECTED]> wrote: > On Fri, Oct 3, 2008 at 9:31 PM, Joshua Drake <[EMAIL PROTECTED]> wrote: > > On Fri, 3 Oct 2008 15:18:26 -0500 > > "Eduardo Arévalo" <[EMAIL PROTECTED]> wrote: > > > >> Hi I am trying to install the portgres of 64btis in centos

Re: [GENERAL] Static functions

2008-10-03 Thread Gurjeet Singh
On Sat, Oct 4, 2008 at 1:36 AM, Tom Lane <[EMAIL PROTECTED]> wrote: > Joseph S <[EMAIL PROTECTED]> writes: > > Aren't static functions supposed to executed only once per transaction? > > There's no promise of that. > Can this be changed? Or does it work only in simpler queries, based on some resu

Re: [GENERAL] Static functions

2008-10-03 Thread Gurjeet Singh
On Sat, Oct 4, 2008 at 8:49 AM, Tom Lane <[EMAIL PROTECTED]> wrote: > "Gurjeet Singh" <[EMAIL PROTECTED]> writes: > > Shouldn't PG make all efforts to not execute something when the result is > > already known? > > Not if said effort would cost more

Re: [GENERAL] Static functions

2008-10-04 Thread Gurjeet Singh
On Sat, Oct 4, 2008 at 6:06 PM, Gregory Stark <[EMAIL PROTECTED]>wrote: > "Gurjeet Singh" <[EMAIL PROTECTED]> writes: > > > On Sat, Oct 4, 2008 at 8:49 AM, Tom Lane <[EMAIL PROTECTED]> wrote: > > > >> "Gurjeet Singh" <[EMAIL PRO

Re: [GENERAL] Monty on MySQL 5.1: "Oops, we did it again"

2008-12-07 Thread Gurjeet Singh
As I read it, he is supportive of the community process that PG follows; I am not so sure he promotes Postgres though :) On Thu, Dec 4, 2008 at 3:56 AM, Bruce Momjian <[EMAIL PROTECTED]> wrote: > Jason Long wrote: > > Greg Smith wrote: > > > I wonder if I'm the only one who just saved a copy of t

Re: [GENERAL] ChronicDB: Live database schema updates with zero downtime

2010-01-13 Thread Gurjeet Singh
On Wed, Jan 13, 2010 at 12:29 AM, ChronicDB wrote: > > [3] http://chronicdb.com/chronicdb_early_adoption_program "Page not found" -- gurjeet.singh @ EnterpriseDB - The Enterprise Postgres Company http://www.enterprisedb.com singh.gurj...@{ gmail | yahoo }.com Twitter/Skype: singh_gurjeet Ma

[GENERAL] ERROR: failed to find conversion function from "unknown" to text

2009-01-05 Thread Gurjeet Singh
Q1: select '' union all select '' Q2: select '' union all select * from (select '' ) as s version: PostgreSQL 8.3.1, compiled by Visual C++ build 1400 Hi All, Q1 works just fine, but Q2 fails with: ERROR: failed to find conversion function from "unknown" to text Q2 is a generalization

Re: [GENERAL] [HACKERS] ERROR: failed to find conversion function from "unknown" to text

2009-01-05 Thread Gurjeet Singh
As I mentioned, we cannot change the query, so adding casts to the query is not an option. I was looking for something external to the query, like a CREATE CAST command that'd resolve the issue. Best regards, On Tue, Jan 6, 2009 at 12:00 PM, Pavel Stehule wrote: > Hello > > 20

Re: [GENERAL] [HACKERS] ERROR: failed to find conversion function from "unknown" to text

2009-01-06 Thread Gurjeet Singh
or PG 8.3.1 too. On Tue, Jan 6, 2009 at 12:15 PM, Pavel Stehule wrote: > 2009/1/6 Gurjeet Singh : > > As I mentioned, we cannot change the query, so adding casts to the query > is > > not an option. I was looking for something external to the query, like a > > CREATE CAS

Re: [GENERAL] [HACKERS] ERROR: failed to find conversion function from "unknown" to text

2009-01-06 Thread Gurjeet Singh
On Tue, Jan 6, 2009 at 2:43 PM, Scott Marlowe wrote: > On Tue, Jan 6, 2009 at 2:04 AM, Gurjeet Singh > wrote: > > I took your cue, and have formulated this solution for 8.3.1 : > > Is there a good reason you're running against a db version with known > bugs instead of

Re: [GENERAL] [HACKERS] ERROR: failed to find conversion function from "unknown" to text

2009-01-06 Thread Gurjeet Singh
On Tue, Jan 6, 2009 at 6:31 PM, Tom Lane wrote: > "Gurjeet Singh" writes: > > create cast (unknown as text) with function unknown2text( unknown ) as > > implicit; > > This is a horrendously bad idea; it will bite your *ss sooner or later, > probably sooner.

  1   2   >