Skip site navigation (1) Skip section navigation (2)

Re: Have psql show current sequnce values - (Resubmission)

From: Dhanaraj M <Dhanaraj(dot)M(at)Sun(dot)COM>
To: Dhanaraj M <Dhanaraj(dot)M(at)Sun(dot)COM>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Have psql show current sequnce values - (Resubmission)
Date: 2006-08-24 12:09:15
Message-ID: 44ED96EB.40502@sun.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Sorry for resubmitting this patch.
Just now I found a problem.
Instead of assigning initial sequence value to 1,
I assign LLONG_MAX to avoid the buffer overflow problem.
Please find the current version here.


Dhanaraj M wrote:

> Hi all,
>
> This patch was discussed a few months ago.
> I could not complete this patch at that time.
> I hope that the current version of my patch is acceptable.
>
> Patch details:
> **************
> 1. Assign a new field called 'Seq Value' for \ds command
> 2. All the sequence values are '1' initially
> 3. After executing the query, call AssignSeqValue()
> 4. This function assigns the respective sequence values back to the 
> resultset
>
>
> Please review and comment on this patch.
>
> Thanks
> Dhanaraj
>
> Tom Lane wrote:
>
>> Dhanaraj M <Dhanaraj(dot)M(at)Sun(dot)COM> writes:
>>  
>>
>>> However, it was not possible to display the seq. value using this.
>>> Hence, I made a small change in the currval() function, so that it 
>>> retrieves the last_value
>>> even if the the value is not cached.
>>>   
>>
>>
>> Breaking currval()'s semantics is not an acceptable solution for this.
>>
>> The best, fully backward compatible solution is for psql to issue
>> "SELECT last_value FROM <seq>" queries to get the values.  This might
>> be a bit tricky to wedge into the structure of describe.c, but I don't
>> see any fundamental reason why it can't be done.
>>
>>             regards, tom lane
>>  
>>


Attachment: patch.patch
Description: text/x-patch (2.5 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2006-08-24 12:55:08
Subject: Re: Tricky bugs in concurrent index build
Previous:From: chrisnospamDate: 2006-08-24 10:51:53
Subject: Re: [PATCHES] selecting large result sets in psql using

pgsql-patches by date

Next:From: Bernd HelmleDate: 2006-08-24 14:51:42
Subject: Re: Updatable views
Previous:From: chrisnospamDate: 2006-08-24 10:51:53
Subject: Re: [PATCHES] selecting large result sets in psql using

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group