Re: [SQL] connecting to postgres server from Access

2001-01-12 Thread Markus Wagner

Hi Joel!

>   http://www.postgresql.org/users-lounge/index.html

Ok, my fault...

> > "cannot create index for the selected field"
> >
> > Then the linked table appears in the tables tab in Access. When trying
> > to open it, I get ("Organisation" is the table to be linked):
> >
> > "ODBC error:
> >  error while executing the query
> >  ERROR: Organisation: Permission denied (#1)"
> 
> Haven't seen this exact error before.


> Are you sure that you found and turned off BOTH read-only options in the
> ODBC driver configuration? (I'm just wondering if this "can't
> create" error is a strange read-only twist.)

This might be an important hint. In the system ODBC configuration I
found that the connection was configured read-only, two times. I changed
both to not to be read-only. But nothing changed.

Then I found under "Protocol" three alternatives: "6.5/6.4", "6.3",
"6.2". So if this is the pg version then I have a problem, because I am
using pg 7.0.

> Also, you might try to take the error at face value: try to create an
> index on the Org field using psql, and see if you run across any errors.

I also tried that. No changes.

> Slimmer but less featureful is Zeos Database Explorer, available at
> 
>   http://www.zeos.dn.ua/eng/index.html
> 
> This is basically a GUI version of psql.

I tried it. The command "show tables" lists my tables. But when making a
"SELECT * FROM " I get "relation  does not exist".
Very strange...

> Either of these tools will let you try your query out from the Windows
> box, and will help us figure out whether this is a PG problem, an
> ODBC problem, an Access problem, etc.

Seems to be a pg problem?

Markus



[SQL] PostGreSql7.1 beta version

2001-01-12 Thread Najm Hashmi

Hi all,
 I am just wondering where can i find the link to down load
PostGreSql7.1 beta versoin . I heard it is very stable my be I can use
it see how many times I tumble on bugs I don't do it intentionally
but it happens to me all the time :)...
Regards.
Najm




[SQL] Serials

2001-01-12 Thread Sharmad Naik



What's the purpose of Serials in Data types of 
postgres ? 
TIA 
Sharmad


Re: [SQL] Serials

2001-01-12 Thread Josh Berkus

Mr. Naik,

> What's the purpose of Serials in Data types of postgres ?
> TIA 
> Sharmad

This topic is more than adequately covered in both the
online documentation and Bruce Momjian's book.  If language
or other problems are preventing you from finding the
correct reference, please reply and I'll give you a pointer.
Othervwise, RTFM.

-Josh Berkus




[SQL] Re: [PHP] Automatic increment

2001-01-12 Thread Josh Berkus

GH, svangemond,

> > Many people do the first SELECT on a form, stuff the
> result in a hidden
> > variable, then do the INSERT in the form's handler.
> This prevents the
> > double- (or triple-) clicking of "submit" resulting in
> extra database
> > inserts.

Actually, that raises a very good question:

If I have a defined sequence 'universal_sq', and I want to
insert rows into a table using 'universal_sq', is there any
reason *not* to use the DEFAULT NEXTVAL('universal_sq')
declaration in the table definition?

For example, if I want to locate the NEXTVAL. do a bunch of
stuff, and then insert the record, does this obligate me to
take the DEFAULT NEXTVAL out of the table and do it the
NEXTVAL insertion in my functions, or is it irrelevant?

-Josh Berkus



[SQL] SQL funtion

2001-01-12 Thread Najm Hashmi

Hi All,
 I have written a very simply function as follows:
create function song_info(int4) returns setof songs as'
   select songs.* from songs
   where $1=song_id'
   language 'sql';
when iIcall it  I get the following:flipr=# select song_info(4);
 ?column?
---
 136428992
(1 row)

Is not it suppose to retrun me the tuple form songs table rather than
oid
If  I want to get a complete tuple what can I do.
Thank you all for your help.
Regards, Najm.





[SQL] pl/pgsql Limits

2001-01-12 Thread Najm Hashmi

Hi All,
  As it is known that any funtion, written in pl/pgsql, can only
retrun one tuple. I am just wondering  it were true as well for function
written in C language. I need to write few function that will retrun
mulitiple rows satsifying a certain set of conditions. Where I can get
some  examples.
Tahnks in advance.
Najm