How to get back the current count of a auto incrementing number.

Ask a Question related to PostgreSQL / PGSQL, Design and Development.

  1. #1

    Default How to get back the current count of a auto incrementing number.

    hi

    How to get the current value of a auto
    incrementing number generated using CREATE SEQUENCE
    seqname START 1

    Is there any way and if yes what is it. Can we run a
    select query and may be a inbuilt function which will
    return the current value of that number?

    Regards.



    __________________________________
    Do you Yahoo!?
    Yahoo! Mail - Find what you need with new enhanced search.
    [url]http://info.mail.yahoo.com/mail_250[/url]

    ---------------------------(end of broadcast)---------------------------
    TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to [email]majordomo@postgresql.org[/email])

    sid tow Guest

  2. Similar Questions and Discussions

    1. Count Number of Downloads for PDF File
      Is there a way using Cold Fusion to count the number of times a particular PDF (or Word) file is downloaded by site visitors? Thanks
    2. incrementing field count. help please!!
      I need user to be able to generate as many rows as they need to update a record. Example - a recipie. I am on Record 5 which is pepperoni pizza....
    3. Incrementing Number in Repeat Region - Help!
      Anyone help on this? PHP/MySQL I have a repeat region displaying records from orders in a CSV format: CalJoe33,18,08/23/2004,FED...
    4. Auto incrementing document revision
      Hello, I have been asked to replicate a feature of Microsoft Word in an InDesign CS document. You can insert an auto updating text field that...
    5. current found count
      I want to hide the status area, but I want the user to still be able to see how many records are currently being browsed--like after you perform a...
  3. #2

    Default Re: How to get back the current count of a auto

    Sid,

    Postgres has an excellent documentation. You can find about what you
    asked here:
    [url]http://www.postgresql.org/docs/8.0/static/functions-sequence.html[/url]
    It always pays off to read the docs first.

    Cheers,
    Csaba.


    On Fri, 2005-01-28 at 12:36, sid tow wrote:
    > hi
    >
    > How to get the current value of a auto
    > incrementing number generated using CREATE SEQUENCE
    > seqname START 1
    >
    > Is there any way and if yes what is it. Can we run a
    > select query and may be a inbuilt function which will
    > return the current value of that number?
    >
    > Regards.
    >
    >
    >
    > __________________________________
    > Do you Yahoo!?
    > Yahoo! Mail - Find what you need with new enhanced search.
    > [url]http://info.mail.yahoo.com/mail_250[/url]
    >
    > ---------------------------(end of broadcast)---------------------------
    > TIP 2: you can get off all lists at once with the unregister command
    > (send "unregister YourEmailAddressHere" to [email]majordomo@postgresql.org[/email])

    ---------------------------(end of broadcast)---------------------------
    TIP 1: subscribe and unsubscribe commands go to [email]majordomo@postgresql.org[/email]

    Csaba Nagy Guest

  4. #3

    Default Re: How to get back the current count of a auto incrementing number.

    On Friday 28 Jan 2005 5:06 pm, sid tow wrote:
    > hi
    >
    > How to get the current value of a auto
    > incrementing number generated using CREATE SEQUENCE
    > seqname START 1
    >
    > Is there any way and if yes what is it. Can we run a
    > select query and may be a inbuilt function which will
    > return the current value of that number?
    [url]http://www.postgresql.org/docs/8.0/static/functions-sequence.html[/url]

    HTH

    Shridhar

    ---------------------------(end of broadcast)---------------------------
    TIP 5: Have you checked our extensive FAQ?

    [url]http://www.postgresql.org/docs/faq[/url]

    Shridhar Daithankar Guest

  5. #4

    Default Re: How to get back the current count of a auto incrementing number.

    On Jan 28, 2005, at 6:36 AM, sid tow wrote:
    > hi
    >
    > How to get the current value of a auto
    > incrementing number generated using CREATE SEQUENCE
    > seqname START 1
    >
    > Is there any way and if yes what is it. Can we run a
    > select query and may be a inbuilt function which will
    > return the current value of that number?
    Look at:

    [url]http://www.postgresql.org/docs/8.0/interactive/functions-sequence.html[/url]

    Sean


    ---------------------------(end of broadcast)---------------------------
    TIP 8: explain analyze is your friend

    Sean Davis Guest

  6. #5

    Default Re: How to get back the current count of a auto incrementing number.


    This question pops about once a day...
    can't the list server grep for "auto increment" and send a link to the
    docs itself ;)

    > hi
    >
    > How to get the current value of a auto
    > incrementing number generated using CREATE SEQUENCE
    > seqname START 1
    >
    > Is there any way and if yes what is it. Can we run a
    > select query and may be a inbuilt function which will
    > return the current value of that number?
    >
    > Regards.
    ---------------------------(end of broadcast)---------------------------
    TIP 6: Have you searched our list archives?

    [url]http://archives.postgresql.org[/url]

    PFC Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139