Unix Technical Forum

problem with serial data type and access

This is a discussion on problem with serial data type and access within the Pgsql General forums, part of the PostgreSQL category; --> I know it's not fully IT with the list, but maybe somebody can help me. I'm dealing with this ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-16-2008, 02:41 PM
Ottavio Campana
 
Posts: n/a
Default problem with serial data type and access

I know it's not fully IT with the list, but maybe somebody can help me.

I'm dealing with this scenario: access 97 is connected through odbc to a
postgresql server. All tables are saved in postgresql and access is used
only to generated the program interface.

Everything works fines, but I'm having problems with the serial data
type. I know a serial is an integer having as default the next value of
a sequence. Since it is an integer, access does not recognize it as an
autoincrement value, and it asks for is value.

Did anyone of you already have this problem?

Thanks...

--
Non c'e' piu' forza nella normalita', c'e' solo monotonia.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFILECusbKx4ZV8clIRAs5cAJ0TQi3mYx2xkjSH9tJXH2 OXETF4fwCfeHxr
CCI2m+0r2lf4KWtlRhiLVrM=
=1fIy
-----END PGP SIGNATURE-----

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-16-2008, 02:41 PM
Scott Marlowe
 
Posts: n/a
Default Re: problem with serial data type and access

On Thu, May 15, 2008 at 7:54 AM, Ottavio Campana <ottavio@campana.vi.it> wrote:
> I know it's not fully IT with the list, but maybe somebody can help me.
>
> I'm dealing with this scenario: access 97 is connected through odbc to a
> postgresql server. All tables are saved in postgresql and access is used
> only to generated the program interface.
>
> Everything works fines, but I'm having problems with the serial data type. I
> know a serial is an integer having as default the next value of a sequence.
> Since it is an integer, access does not recognize it as an autoincrement
> value, and it asks for is value.
>
> Did anyone of you already have this problem?


Can you feed it a value of DEFAULT???

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-16-2008, 02:41 PM
Ottavio Campana
 
Posts: n/a
Default Re: problem with serial data type and access

Scott Marlowe ha scritto:
> On Thu, May 15, 2008 at 7:54 AM, Ottavio Campana <ottavio@campana.vi.it> wrote:
>> I know it's not fully IT with the list, but maybe somebody can help me.
>>
>> I'm dealing with this scenario: access 97 is connected through odbc toa
>> postgresql server. All tables are saved in postgresql and access is used
>> only to generated the program interface.
>>
>> Everything works fines, but I'm having problems with the serial data type. I
>> know a serial is an integer having as default the next value of a sequence.
>> Since it is an integer, access does not recognize it as an autoincrement
>> value, and it asks for is value.
>>
>> Did anyone of you already have this problem?

>
> Can you feed it a value of DEFAULT???


I'd like to, but I don't think I could do it.

The fact is that the serial data type is in pratice an integer, and when
I also try to connect with pgadminIII I see an integer data type and not
a serial. I think that since it sees an integer, it does not understand
that it is a serial, and access does not recognize it as autoincrement.

I'm stuck at this point...

--
Non c'e' piu' forza nella normalita', c'e' solo monotonia.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFILGGGsbKx4ZV8clIRAjmkAJ90+pqf1PV8bt3ofvSb3q UH0sCpuQCfWYy6
8Ny/ZYdi1xQBudHq6rXEOsc=
=mHy3
-----END PGP SIGNATURE-----

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 05-16-2008, 02:41 PM
Adrian Klaver
 
Posts: n/a
Default Re: problem with serial data type and access

On Thursday 15 May 2008 9:14 am, Ottavio Campana wrote:
> Scott Marlowe ha scritto:
> > On Thu, May 15, 2008 at 7:54 AM, Ottavio Campana <ottavio@campana.vi.it>

wrote:
> >> I know it's not fully IT with the list, but maybe somebody can help me.
> >>
> >> I'm dealing with this scenario: access 97 is connected through odbc to a
> >> postgresql server. All tables are saved in postgresql and access is used
> >> only to generated the program interface.
> >>
> >> Everything works fines, but I'm having problems with the serial data
> >> type. I know a serial is an integer having as default the next value of
> >> a sequence. Since it is an integer, access does not recognize it as an
> >> autoincrement value, and it asks for is value.
> >>
> >> Did anyone of you already have this problem?

> >
> > Can you feed it a value of DEFAULT???

>
> I'd like to, but I don't think I could do it.
>
> The fact is that the serial data type is in pratice an integer, and when
> I also try to connect with pgadminIII I see an integer data type and not
> a serial. I think that since it sees an integer, it does not understand
> that it is a serial, and access does not recognize it as autoincrement.
>
> I'm stuck at this point...

Did you mark this field as the primary key when you linked the table?

--
Adrian Klaver
aklaver@comcast.net

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 05-18-2008, 11:02 PM
Adrian Klaver
 
Posts: n/a
Default Re: problem with serial data type and access

On Thursday 15 May 2008 11:44 pm, Ottavio Campana wrote:
> Adrian Klaver ha scritto:
> >> The fact is that the serial data type is in pratice an integer, and when
> >> I also try to connect with pgadminIII I see an integer data type and not
> >> a serial. I think that since it sees an integer, it does not understand
> >> that it is a serial, and access does not recognize it as autoincrement.
> >>
> >> I'm stuck at this point...

> >
> > Did you mark this field as the primary key when you linked the table?

>
> yes I did


Just out of curiosity, create a test table using the WITH OIDS clause and a
serial data type column along with some test columns and try to INSERT a
record.

--
Adrian Klaver
aklaver@comcast.net

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 05-18-2008, 11:02 PM
Richard Broersma
 
Posts: n/a
Default Re: problem with serial data type and access

On Thu, May 15, 2008 at 6:54 AM, Ottavio Campana <ottavio@campana.vi.it> wrote:
> I'm dealing with this scenario: access 97 is connected through odbc to a
> postgresql server. All tables are saved in postgresql and access is used
> only to generated the program interface.
>
> Everything works fines, but I'm having problems with the serial data type. I
> know a serial is an integer having as default the next value of a sequence.
> Since it is an integer, access does not recognize it as an autoincrement
> value, and it asks for is value.
>
> Did anyone of you already have this problem?


Back when I was using V95, I remember having this problem and finding
a simple way to get around it. The only problem is that I can't
remember what it was. MS-Access 2003 doesn't seem to suffer from this
problem.

One brute-force method to get around it is to create a function that
uses an ADO connection to call the PostgreSQL back-end for
nextval('sequence_name'). Next using the Before_insert() event in
access, you could manually set the new id for your primary key and
complete the record insertion.

--
Regards,
Richard Broersma Jr.

Visit the Los Angles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:32 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com