[SQL] Table secure problem.

2000-11-08 Thread Mateusz Mazur

Hi.

(Sorry for my english -I'am not a nativ speaker)

I have some problem. I show it with example:

I have base names for e.g. "db".
I have also user "joe" (in pg_shadow). Joe is not a superuser or somethink
like that his is normal user.
He connect to db. He can't do anything because I don't give him any grants,
but he can create new tables. and ther is a problem. He could create table
for e.g. with large object field and put there GB of data and system break
down. What should I do. Joe must connect to the base because he must select
some data from table but it must be all. I will be very greatfull for any
sugestion.

Mateusz Mazur
POLAND
[EMAIL PROTECTED]



Re: [SQL] how to index a numeric(12,2) column?

2000-11-08 Thread Forest Wilkinson

>> I'd like to create an index on a column whose type is NUMERIC(12,2).
>> There appears to be no default operator class for the numeric type.
>
>Uh, what version are you using?  Works fine for me in 7.0.2.

Sorry; I hit send before adding that information.  I'm using postgres
6.5.3 on i386 Red Hat 6.1.

It allows me to create an index on a NUMERIC(12,2) field using the
int8_ops class, but I'm wondering if this might have some undesirable
hidden side effects.

CREATE TABLE foo (id INTEGER, bar NUMERIC(12,2));
CREATE INDEX foo_idx on foo (bar int8_ops);




Re: [SQL] how to index a numeric(12,2) column?

2000-11-08 Thread Tom Lane

Forest Wilkinson <[EMAIL PROTECTED]> writes:
> Sorry; I hit send before adding that information.  I'm using postgres
> 6.5.3 on i386 Red Hat 6.1.

Time to update, then.

> It allows me to create an index on a NUMERIC(12,2) field using the
> int8_ops class, but I'm wondering if this might have some undesirable
> hidden side effects.

Yes, and they won't be too hidden either: it won't work :-(

Current sources check for that sort of type mismatch, but 6.5 failed to
do so.

regards, tom lane



[SQL] ./configure problems

2000-11-08 Thread rocael

HI!

I did this to install postgres in a new machine:
./configure --prefix=/usr/local/pgsql --with-tcl --with-perl

and I got this:
loading cache ./config.cache
checking host system type... /usr/src/pgsql/postgresql-7.0.2/src/config.guess:
13497442: No space left on device
/usr/src/pggsql/postgresql-4.0.2/sr/config.guess: 135012768: No space left on
device
configure: error: can not guess host type: you must specify one

I have 8GB in the /usr directory
Do somebody know whats going on?

Thanks

Rocael


Get free email and a permanent address at http://www.netaddress.com/?N=1



[SQL] shared memory problem

2000-11-08 Thread rocael

HI all!

I did this:

/usr/local/pgsql/bin/postmaster -B 1000 -o "-S 2000" -S -D
/usr/local/pgsql/data

and it says:
IpcMemoryCreate: shmget failed (Invalid argument) key=5432001,
size=8899584,permission=600
This type of erro is usually caused by an improper shared memory or System V
IPC semaphore configuration. Form more information

what should I do, I am running a 600Mhz Celeron with 512RAM, I have tried the
same command in others machines and works fine,
thank you for your help,
Rocael.


Get free email and a permanent address at http://www.netaddress.com/?N=1



Re: [SQL] shared memory problem

2000-11-08 Thread Tom Lane

<[EMAIL PROTECTED]> writes:
> /usr/local/pgsql/bin/postmaster -B 1000 -o "-S 2000" -S -D
> /usr/local/pgsql/data

> and it says:
> IpcMemoryCreate: shmget failed (Invalid argument) key=5432001,
> size=8899584,permission=600
> This type of erro is usually caused by an improper shared memory or System V
> IPC semaphore configuration. Form more information

Most likely your kernel isn't set to allow shared memory blocks as
large as 8M.

regards, tom lane



Re: [SQL] Help! Storing trees in Postgres

2000-11-08 Thread kovacsz

> Is there any way to implement a query in Postgres that would be in some way
> analogues to Oracle's START WITH/CONNECT BY structure?
Unfortunately, no such statements. Instead, you should write your own
functions which can operate on your own defined table. The table
represents the edges of the tree ("from" and "to"). You might have a look
on
ftp://pc10.radnoti-szeged.sulinet.hu/home/kovacsz/Linux/PostgreSQL/strukturak/

for some details about using partially ordered trees.

Regards, Zoltan







[SQL] Oracle, ODBC, MS IIS -> problem!

2000-11-08 Thread ANDREAS STEINBACH

Hi,

My problem is:

I have to create a web interface for an Oracle database. I use MS Internet
Information Server, ODBC driver (tried one from MS and one from Oracle) and an
Oracle database (I have no permission to change anything in that database).

I don't have a problem accessing one table, but I need to read fields of
several tables and some of them have the same name. I simplified my problem to
the following example:

select p.pkey, p.text, d.dkey, d.text from schema1.product p, schema1.details d
where p.pkey = 1

I created a webpage containing the following:

--

<%  Set cn = Server.CreateObject("ADODB.Connection")

cn.open "dsn=XXX;uid=XXX;pwd=XXX"
abfrage="select p.pkey, p.text, d.dkey, d.text from schema1.product p,
schema1.details d where p.pkey = 1"

Set rs = cn.Execute(abrage) %>
<% m_produkt=Server.HTMLEncode(rs.Fields("p.pkey").Value)%>

-

The last line give a (german) error message that I will try to translate:

ADODB.Fields-error '800a0cc1' 

ADO couldn't find an object in the list, that corresponds to the name or the
ordinal reference, that was requested by the application.


Is there anybody out there who can be of help on that matter? I really tried to
find an answer myself, but now I'm stuck.

Any help is highly appreciated. Thanks in advance,

Andreas (Vienna, Austria, Europe, Earth)



[SQL] Help with GROUP BY

2000-11-08 Thread Jean-Christophe Boggio

Hi,

I have a (quite) big table with ~3M rows.

Every row has a NBPOINTS (int4) and a REASON (int4)

select sum(nbpoints) from points;
  it takes about 10s

select sum(nbpoints) from points group by reason
  it takes about 210s

Same table structure, same data on Oracle gives respectively 8 and 22
seconds.

Is there a way to optimize this ?

(REASON is indexed though I can see no interest in this query.)

TIA!

--
Jean-Christophe Boggio
[EMAIL PROTECTED]
Independant Consultant and Developer
Delphi, Linux, Oracle, Perl





[SQL] insert value of form - checkboxes

2000-11-08 Thread Astrid Hexsel

Hello all,

 I have a form which has got checkboxes and I am having problems  to have their
values stored in different rows of a table.


What I have done is: 

# colour_id is the name of my checkboxes in the input tag

 
etc ...

# I put all the values into the array and split them

$colour = $formdata{'colour_id'};
@colours = split (/,/, $colour);

#then I want to insert then into a table (called cart)in the row called colour_id.
If I have more than one value they have to be in different rows.

# my code:

  foreach $colour(@colours)
{
   $qry = INSERT INTO cart VALUES 
  ('$session_id', '$range_id', '$colour')
}

And what happens is that I am only getting just
one value now inserted in the row. If for example I checked 3 boxes I will get
only the last
one.

The foreach loop works fine out of the query.

Thanks a lot for any help.

Astrid






 


   





[ADMIN] alter pg_shadow

2000-11-08 Thread pgsql-sql

Is it safe to rename 'postgres' to any__name?

like

update pg_shadow set usename = 'any__name' where usename = 'postgres';


Sherwin