[SQL] grant select on ALL(?) to dbuser;

2000-10-03 Thread Marcin Mazurek

Hi,
is something like this possible?
I have to grant select priviliges to dump database, and I was wondering if
there is easer way to do it then name one, by one every table.

maz

Marcin Mazurek

--  
Kierownik Działu Systemowego
MULTINET SA o/Poznan
http://www.multinet.pl/



Re: [SQL] grant select on ALL(?) to dbuser;

2000-10-03 Thread Marcin Mazurek

Antti Linno ([EMAIL PROTECTED]) napisał:

> Hm, I usually use
> pg_dump -f smthng.out dbname -u
> after that program asks for username and password,
> there were some possibilities within postgres too, but you can find them
> yourself. And why not to dump all data as superuser, that way u have no
> problems with privileges at all.
 i want to do it via cron, and rather not user any superusers, except for
this it whould by nice to know how to do it not only for pg_dump:)
maz

Marcin Mazurek

--  
Kierownik Działu Systemowego
MULTINET SA o/Poznan
http://www.multinet.pl/



[SQL] select with function per row

2000-10-30 Thread Marcin Mazurek

Hi,
I have a table with FQDN. I'm trying to take from it the second part which
desribed a city. Query isn't too clear but with what is important that
whole substr was counted once and applied to every row. Can I (how?) force
executor to run this substr on every row of my table?

mtldb=# select substr(substr(s.nazwa,strpos(s.nazwa,'a.')+2),1,
textlen(s.nazwa)-strpos(s.nazwa,+'.m'))
from serwery_old s;
 substr

 poznan
 mtl.pl
 ka.kie

tia
maz

Marcin Mazurek

--  
Kierownik Działu Systemowego
MULTINET SA o/Poznan
http://www.multinet.pl/



[SQL] rules on select - different output

2000-12-03 Thread Marcin Mazurek

Hi,

I'd like my rule to change the row which is resulting form select.
I'd like to get a row conforming to t1 from t2.
CREATE TABLE t1 (id int, f1 int, f2 int, f3 text, f4 text);
CREATE TABLE t2 (id int, p1 int, p2 text);
CREATE RULE r1 AS ON SELECT TO t2 DO INSTEAD
   SELECT id, p1 AS f1, NULL::INT AS f2, p2 as f3, NULL::TEXT as f4 FROM
t2;

psql:test.sql:11: ERROR:  select rules target list must match event
relations st
ructure
test=#

Is there another way to do it?
tia
mazek




[SQL] to_timestamp, problem

2000-12-15 Thread Marcin Mazurek

Hi,
Can anyone explain to me why this doesn't work. Seems to be some stupid (my)
mistake:

mtldb=# SELECT  to_timestamp('05121445482000', 'MMDDHHMISS');
  to_timestamp

 2000-05-12 14:45:48+02
(1 row)

mtldb=# SELECT  to_timestamp('2512144548', 'MMDDHHMISS');
 to_timestamp
--
 invalid
(1 row)

pg 7.0.3, linux 2.2

tia
mazek

Marcin Mazurek

--  
Kierownik Działu Systemowego
MULTINET SA o/Poznan
http://www.multinet.pl/