Re: [GENERAL] Getting started on Linux RH6.2 ...

2000-11-23 Thread Richard Huxton

- Original Message -
From: <[EMAIL PROTECTED]>


> Hello
>
> It is probably something quite silly but I have installed all the binaries
> from the RH6.2 installation disk and browsed through the manual.  These
> are:
>
> postgresql-6.5.3-6.i386.rpmpostgresql-python-6.5.3-6.i386.rpm
etc
> from which you will see the version.

There are newer releases - you might want to get hold of 7.0 rpms before
using it in a live system.

> Firstly the tree as described in the Administrators guide in
> /usr/doc/postgresql-6.5.3/admin/layout.htm is very much pruned - in fact
> the only directories under /usr/lib/pgsql are:
[snip]
> and there is no directory /usr/local/pgsql at all.

RPM installs tend to put files in different places than when you compile -
try
  rpm -ql 
to see where things have been put.

> postgres $ postmaster
> /usr/bin/postmaster does not know where to find the database system data.
> You must specify the directory that contains the database system either by
> specifying the -D invocation option or by setting the PGDATA environment
> variable.
>
> No data directory -- can't proceed.

Two things spring to mind - "initdb" needs to be run to set up the database
(you should have a "data" directory somewhere with datafiles within). Don't
know if the RPMs have already run that or not.

Second thing - check in /etc/rc.d/init.d/ for a postgres script - if so try
running /etc/rc.d/init.d/postgres start

- Richard Huxton




[GENERAL] Re: What is the size of DB in Postgresql??

2000-11-23 Thread Ould



Ould wrote:
The size of any file is limitted (for exemple in linux 2.2.x to 2GO). If
database (tablespace) is considered as file how we can atteign 60 GO?


> Ould wrote:
>
> > Hello,
> >
> > I have 2 questions:
> > 1) What is th max size of database we can create in Postegrsql?
> > 2) Suppose I have two simular  databases: mydb1, mydb2 (containig the
> > same number of table, ...etc.), how I can copy the contents of mydb1
> > into mydb2? if mydb2 is on a remote machine, how I can do this?
> >
> > Thanks




Re: [GENERAL] Re: What is the size of DB in Postgresql??

2000-11-23 Thread Poul L. Christiansen

PostgreSQL splits the table files into several files transparently, so
you don't have to worry about that.

I think Linux 2.4.x will have this limit removed.

But when you dump at 60GB table to disk on linux 2.2.x, you can use the
utilities "split" and "gzip" to avoid running into the 2GB barrier.

Poul L. Christiansen

Ould wrote:
> 
> Ould wrote:
> The size of any file is limitted (for exemple in linux 2.2.x to 2GO). If
> database (tablespace) is considered as file how we can atteign 60 GO?
> 
> > Ould wrote:
> >
> > > Hello,
> > >
> > > I have 2 questions:
> > > 1) What is th max size of database we can create in Postegrsql?
> > > 2) Suppose I have two simular  databases: mydb1, mydb2 (containig the
> > > same number of table, ...etc.), how I can copy the contents of mydb1
> > > into mydb2? if mydb2 is on a remote machine, how I can do this?
> > >
> > > Thanks



[GENERAL] Trouble With Strings

2000-11-23 Thread Colin Taylor

Hi,
I have been having a few problems with strings (varchar)s.
How can I insert a quote ' character in a string?
The following, needless to say does not work:

INSERT INTO table (string) VALUES ('colin's');

Also, are there any other characters that need special attention in order to
put them into the table?
And how can I handle them?
Thanks,
Colin




Re: [GENERAL] trouble migrating from 6.3.2 (IRIX) to 7.0.2 (Linux)

2000-11-23 Thread George Armhold

Tom Lane wrote:

> > CREATE TABLE pfam (swiss_id varchar(16) NOT NULL, pfam_family
> > varchar(32), comment varchar(80), sequence_data varchar(-5));
> 
> Hrm.  varchar(-5) is pretty obviously broken :-(.  I don't want to
> guess what sort of aberration prompted that output from pg_dump
> --- 6.3.2 is before my time with Postgres.  Try editing the dump
> file to have a more reasonable value for the varchar max width,
> and see how it goes...

Hmm, I seem to be getting negative values for tables that were created
without a maximum char length.  Is (was) it legal postgres syntax to
say something like 

   create table foo (mytext varchar);

without a maximum length constraint?  psql (or perhaps the Perl
interface) let me create such tables under 6.5.3 and they've worked
fine, up until this pg_dump.   Would it be safe to simply edit the
dumped file, change the negative values to something reasonable and
reload the DB?

Thank you for your assistance.


--
George Armhold
Rutgers University
Bioinformatics Initiative



[GENERAL] MS-ACCESS -> PGSQL

2000-11-23 Thread Enrico Comini

I have a customer that works on a MDB database.

There is a simple way to port data in the PGSQL database in his site (i use
php) ?





[GENERAL] pg_dump:cannot find function for trigger

2000-11-23 Thread Claudio Grillo


Hello:

After creating the tables tb_bombas and tb_abastecimentos
as follows

\connect f
drop table tb_bombas;
CREATE TABLE "tb_bombas" (
"id_bomba" int2 PRIMARY KEY,
"tipo_bomba" char,
"estado_bomba" int2,
"data_atualizacao" datetime);
CREATE TABLE "tb_abastecimentos" (
"id_bomba" int2 references tb_bombas(id_bomba),
"data_abastecimento" datetime NOT NULL,
"volume" int4,
"valor" int4,
"estado" character,
constraint pk_abastecimentos primary
key(id_bomba,data_abastecimento)
);

and using pg_dump , I got the following error message :

--  last builtin oid is 17216
--  reading user-defined types
--  reading user-defined functions
--  reading user-defined aggregates
--  reading user-defined operators
--  reading user-defined tables
--  finding Triggers for relation: 'tb_bombas'
getTables(): relation 'tb_bombas': cannot find function with oid 1654
for trigger RI_ConstraintTrigger_28974

But I can find de procedure with oid 1654 in the pg_proc, and the
reference to this function in pg_trigger:

pg_trigger

tgrelid|tgname
|tgfoid|tgtype|tgenabled|tgisconstraint|tgconstrname|tgconstrrelid|tgdeferrable|tginitdeferred|tgnargs|tgattr|tgargs

---+--+--+--+-+--++-++--+---+--+--

  28928|RI_ConstraintTrigger_28974|  1654| 9|t|t
|   |28956|f   |f |  6|
|\000tb_abastecimentos\000tb_bombas\000UNSPECIFIED\000id_bomba\000id_bomba\000

(1 row)

pg_proc
proname
|proowner|prolang|proisinh|proistrusted|proiscachable|pronargs|proretset|prorettype|proargtypes|probyte_pct|properbyte_cpu|propercall_cpu|prooutin_ratio|prosrc

|probin
++---+++-++-+--+---+---+--+--+--++--

RI_FKey_noaction_del|  40| 11|f   |t   |f
|   0|f| 0|   |100|
0| 0|   100|RI_FKey_noaction_del|-
(1 row)

I can't dump my database because the error makes pg_dump to exit.
So, i will be grateful  for any help.



Thanks.






[GENERAL] Search engine on http://www.postgresql.org ...

2000-11-23 Thread The Hermit Hacker


After cursing over this for I don't know how long, its was recently
brought to my attention that the C search.cgi that comes with UDMsearch
just might not be up to snuff, compared to some of the other interfaces
...

After some investigation, we've installed a mod_perl front-end to the
database that, with ~10million rows of data and 95k documents loaded,
appears to be highly responsive ...

We've just finished loading up the complete web site, and welcome feedback
on this, including sample searches that ppl feel are taking too long, so
that I can test it from here ... and from what page you've tested it ...

Marc G. Fournier   ICQ#7615664   IRC Nick: Scrappy
Systems Administrator @ hub.org 
primary: [EMAIL PROTECTED]   secondary: scrappy@{freebsd|postgresql}.org 




[GENERAL] Help with pg_trigger

2000-11-23 Thread Jason Davies

Hi,

I've been able to use pg_trigger.tgargs to get relationships between foreign
keys. Now I want to get the update, delete etc. rules. Any idea how?

If possible could you tell me what each of the columns in pg_trigger are for,
because I have no idea, and I can't find it in the docs.

Thankyou for your help,
Jason

=
Jason Davies,

 _  _ _|_ _ _  _  _| _| www.netspade.com
| |(/_ | _\|_)(_|(_|(/_   | programming tutorials
   |  | programming community
---   | programming news

__
Do You Yahoo!?
Yahoo! Calendar - Get organized for the holidays!
http://calendar.yahoo.com/



[GENERAL] Re: [PORTS] Updated RPMset available (7.0.3-2)

2000-11-23 Thread Thomas Lockhart

> Available at:
> ftp://ftp.postgresql.org/pub/binary/v7.0.3/RPMS
> or on your favorite PostgreSQL mirror.
> PPC RPM's should be available soon, as should Mandrake 7.1 RPM's.

I've just posted the RPMs for Mandrake. They built without any changes
to the spec file (thanks Lamar!) except of course for putting the "2mdk"
as the release.

   - Thomas

> Caldera eServer 2.3, RedHat 6.x and 7.0, TurboLinux 6.0.4, and SuSE 6.4
> and 7.0 i386 binary RPM's are available, and a cross-distribution
> capable source RPM is also available.  Source RPM's for eServer 2.3 and
> SuSE are also available, and are packaged in the respective directory.
> The SuSE RPM's, due to their different source, are not updated to
> 7.0.3-2, as the dependency problem doesn't exist on them.



[GENERAL]

2000-11-23 Thread turing2000

Please, help me.
I configure/compile perl with option ( other options stay default ):

./Configure -Dprefix=/usr/local/perl -Duseshrplib
make
make install

I add string '/usr/local/perl/lib/5.6.0/i686-linux/CORE' 
in file /etc/ld.so.conf and call program 'ldconfig'.

Environment: 
LD_LIBRARY_PATH=/usr/local/pgsql/lib:/usr/local/perl/lib/5.6.0/i686-linux/CORE

All is OK for perl. But in psql:

\c db_name

create function perl_hnd() returns opaque as'
/usr/local/perl/lib/5.6.0/i686-linux/CORE/libperl.so' language 'C';

create trusted procedural language 'perl' 
handler perl_hnd lancompiler 'perlcompiler';

create function f( int4, int4 ) returns int4 as'
return $_[0] + $_[1]; 'language 'perl';

db_name=> select f(2,2);
ERROR:  Can't find function perl_hnd in file 
/usr/local/perl/lib/5.6.0/i686-linux/CORE/libperl.so

Please, help me!
  
  turing2000




[GENERAL] Matrix implementation?

2000-11-23 Thread Philip Warner


Has anyone ever implemented a matrix data type that they would be willing
to share? All I want is basic addition & subtraction (don't even need
multipication), but an avg & sum implementation would be nice...



Philip Warner| __---_
Albatross Consulting Pty. Ltd.   |/   -  \
(A.B.N. 75 008 659 498)  |  /(@)   __---_
Tel: (+61) 0500 83 82 81 | _  \
Fax: (+61) 0500 83 82 82 | ___ |
Http://www.rhyme.com.au  |/   \|
 |----
PGP key available upon request,  |  /
and from pgp5.ai.mit.edu:11371   |/



[GENERAL] Compiling postgresql 7.0.3 for WinNT

2000-11-23 Thread Jose Manuel Lorenzo Lopez

Hello community,

I want to compile postgresql 7.0.3 on my WinNT at work, but I don't 
know how! Am I supposed to compile it with VisualC++, as I read in 
the docs I hope not, cause I am only a poor system admin!! :)
I have cygwin-tools on my machine so I hoped that's all I need! 

Can anybody guide me a bit or tell me where I can read docs for this?

Thanks a lot in advance!!! :)

Greetings / Un saludo

José Manuel Lorenzo López
 
-- 
**
** José Manuel Lorenzo López**
**  **
** ICA Informationssysteme Consulting & Anwendungsgesellschaft mbH  **
** Dept. SAP Basis R/3  VBue**
**  **
** e-mail to: [EMAIL PROTECTED]**
**



[GENERAL] plz, Help!! HOW CAN I GET THE ROWNUM IN POSTGRES TABLE AS I DID WITH ORACLE!!

2000-11-23 Thread BaiJie




I KNOW THERE IS A OID FIELD ,BUT IT 'S WIRED , 
NOT A INTEGER INDEX FROM I TO
CURRENT ROW NUMBER!! HOW CAN I GET THE TRUE ROW 
NUMBER IN POSTGRESQL!!


[GENERAL] Backward Compatibility

2000-11-23 Thread rwk

I have an old Postgres server (v6.3) running on a machine which I do not
control and cannot update.

I have a new machine which came with Postgres 7.0.2, which I do control.

I need to be able to talk to the v6.3 server from the new machine.

Can this be done?  When I try I get:

newMachine$ psql -h oldMachine myDatabase
psql: Unsupported frontend protocol.

Please reply to: [EMAIL PROTECTED]

Thanks,
Dick



[GENERAL] pgaccess

2000-11-23 Thread Olivier Cherrier

Hi all.


I would like to use pgaccess with a developpement server.

I red the page "http://www.postgresql.org/docs/admin/x377.htm" but 
didn't understand if I have to include the both "--with-tcl" and 
"--with-x" on the server in the compilation. (The server is a BSD-i386)
Thus, I have no X-server on its. Is it a problem ?


By the way, what do I need on the client side to use pgaccess ?
I think I have to install the client PostgreSQL and pgaccess. Do I need 
special compilation options for the client ?


I am not a specialist in PostgreSQL. I have only simple applications done.


Could anyone give me help on the requirements for pgaccess use or where 
I can read documentation on it ?

Thanks in advance.

Olivier.




[GENERAL] Will there be replication support in 7.1 from erserver.com ?

2000-11-23 Thread Dirk Lutzebaeck


Subject says it all I guess. What is the relationship between 7.1 and
the new features added by www.erserver.com (ie. adding replication
functionality to Postgresql which will be open source)?

Dirk



[GENERAL] PostgreSQL on RedHat High Availability Server.

2000-11-23 Thread Ralph Allan Rice

Anyone out there used PostgreSQL on Redhat's High Availability Server? 
We are trying to determine if a RedHat/PostgreSQL combo could be used in
a dual-redundant manner, such as a Active/Inactive cluster
configuration.  Anyone out there do this?  Any problems, gripes, or
success stories? Please respond to ralph AT pcioh.com.  Thank you.
-- 
Ralph Allan Rice
System Analyst
Performace Concepts, Inc.




[GENERAL] PostgreSQL as windows 2000 Service

2000-11-23 Thread Luis =?unknown?q?Maga=F1a?=

Hi:

Wonder if any of you know how to setup a postgreSQL server as a windows 2000 service 
or have a URL or document on how to do it.

Thank you

---
Luis Magaña
Gnovus Networks & Software
www.gnovus.com
Tel. +52 (7) 4422425
[EMAIL PROTECTED]





Re: [GENERAL] Running several postmaster using same database in parallel

2000-11-23 Thread Valter Mazzola

many users have asked for this feature (ie load balancing,clustering, of 1 
postgresql database)
but no answer from mailing-list, and no planning for this important feature, 
i don't understand why.
Why not set-up a site to found this project with donations... on 
postgresql.org?

valter mazzola


_
Get more from the Web.  FREE MSN Explorer download : http://explorer.msn.com




Re: [GENERAL] MS-ACCESS -> PGSQL

2000-11-23 Thread Peter Pilsl

On Thu, Nov 23, 2000 at 01:21:14PM +0100, Enrico Comini wrote:
> I have a customer that works on a MDB database.
> 
> There is a simple way to port data in the PGSQL database in his site (i use
> php) ?
> 

there is a odbc-driver for postgreSQL for win-applications, that you
can use for copy/paste in access I guess ...

hope this helps,
peter

-- 
mag. peter pilsl

phone: +43 676 3574035
fax  : +43 676 3546512
email: [EMAIL PROTECTED]
sms  : [EMAIL PROTECTED]

pgp-key available



[GENERAL] make check and make installcheck

2000-11-23 Thread Mathieu Arnold

Hi

I was playing with a snapshot and doing some regression tests just in
case when i discovered that if i use a locale (fr_FR for instance), some
tests fails because the output doesn't not look like the default one
(without locales).
I believe the failure of these tests are not really bad as it's just
things like :


*** 246,256 
  SELECT '' AS to_char_13, to_char(q2, 'L.000')  FROM
INT8_TBL;
   to_char_13 |to_char
  +
! |456.000
! |   4567890123456789.000
! |123.000
! |   4567890123456789.000
! |  -4567890123456789.000
  (5 rows)

  SELECT '' AS to_char_14, to_char(q2, 'FM.999') FROM
INT8_TBL;
--- 246,256 
  SELECT '' AS to_char_13, to_char(q2, 'L.000')  FROM
INT8_TBL;
   to_char_13 |to_char
  +
! | F  456.000
! | F 4567890123456789.000
! | F  123.000
! | F 4567890123456789.000
! | F-4567890123456789.000
  (5 rows)

  SELECT '' AS to_char_14, to_char(q2, 'FM.999') FROM
INT8_TBL;

==

does someone think that someone should do something just not to scare
people ? :)

-- 
Mathieu Arnold



[GENERAL] selecting data from multiple DBs

2000-11-23 Thread Giovanni Tummarello

Hello .. on the same machine i have several DBs.. i owuld like to do a query 
that joins results from different ones .. is ther eany way to do it in 
postgres? i would expect something list

select foo1 from database1.mytable,database2.mytable etc.. ec.

but i have found no way..

i woudl be very surprised if there was no way to do it.. since Postgres has the 
UID concept on any record of any database..
thanks for any info

Sincerley
Giovanni Tummarello
[EMAIL PROTECTED]


Fight Spam! Join CAUCE (Coalition Against Unsolicited Commercial Email)
   at http://www.cauce.org/ and tell your Congresspeople how Spam mailings
   hurt you. Help protect genuine Internet commerce: Outlaw UCE Spamming.



Re: [GENERAL] Backward Compatibility

2000-11-23 Thread Tom Lane

[EMAIL PROTECTED] writes:
> I need to be able to talk to the v6.3 server from the new machine.

You'll have to install a 6.3.x libpq and psql for that, I'm afraid.

regards, tom lane



Re: [GENERAL] my C pgm

2000-11-23 Thread bmccoy

On Thu, 16 Nov 2000, Lisa Reilman wrote:

> This program is suppose to have averagefunc that accepts 5 floating
> point numbers as arguments and return the average to two decimal places.
>
> I keep getting syntax errors on lines 6 & 26 and on line 29 is says
> unspecified a,b,c,d,e.

Not sure what this has to do with PostgreSQL, but this compiled and ran
fairly cleanly for me, after I fixed one simple thing.

> 5  float num1, num2, num3, num4, num4, num5, avg;
 ^^

No need to make these global variables outside of main.  You also declared
num4 twice.

It ran fine for me then.  What C compiler are you using?

Brett W. McCoy
 http://www.chapelperilous.net/~bmccoy/
---
CONGRATULATIONS!  Now should I make thinly veiled comments about
DIGNITY, self-esteem and finding TRUE FUN in your RIGHT VENTRICLE??




[GENERAL] RE: [HACKERS] Enum type emulation: problem with opaque type in PL/pgSQL functions

2000-11-23 Thread Christopher Kings-Lynne

> I don't care how but I need to emulate ENUM type, just to convert 
> MySQL dumps to PostgreSQL. E.g. ENUM values 
> stored in MySQL dump should be restorable in Postgres without any 
> conversion.

In MySQL, ENUM is like this:

create table blah (
sex ENUM ('M', 'F')
);

This can be emulated in Postgres like this:

create table blah (
sex CHAR(1) CHECK (sex IN ('M', 'F'))
);

The _real_ trick is implementing MySQL sets in Postgres...

Chris




RE: [GENERAL] Running several postmaster using same database in parallel

2000-11-23 Thread Willis, Ian (Ento, Canberra)

My guess is that the problem is a very difficult one to solve well. The
backends have to reliably communicate between each other in order to stop
two processes writing to the one record. The communication times between 2
processes on the one machine and on two different machines would be at least
1000 time greater. Think of cars going through an intersection with no
traffic lights, just by slowing some cars up and speeding up others gaps can
be made and the problem can be managed. Now think of the same problem with
cars made 1000 time longer, your earlier solution no longer works so well
and the best solution would be to build a different kind of intersection.
The best way would be to make the road a lot wider and to use some sort of
synchronous protocols like traffic lights :-)
Implementations anyone 

-Original Message-
From: Valter Mazzola [mailto:[EMAIL PROTECTED]]
Sent: Friday, 24 November 2000 7:24 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [GENERAL] Running several postmaster using same database in
parallel


many users have asked for this feature (ie load balancing,clustering, of 1 
postgresql database)
but no answer from mailing-list, and no planning for this important feature,

i don't understand why.
Why not set-up a site to found this project with donations... on 
postgresql.org?

valter mazzola



_
Get more from the Web.  FREE MSN Explorer download : http://explorer.msn.com



Re: [GENERAL] plz, Help!! HOW CAN I GET THE ROWNUM IN POSTGRES TABLE AS I DID WITH ORACLE!!

2000-11-23 Thread Igor' Robul'

On Mon, Nov 20, 2000 at 12:44:20PM +0800, BaiJie wrote:
> I KNOW THERE IS A OID FIELD ,BUT IT 'S WIRED , NOT A INTEGER INDEX FROM I TO
> CURRENT ROW NUMBER!! HOW CAN I GET THE TRUE ROW NUMBER IN POSTGRESQL!!
At first, don't use all caps. 

-- 
Igor' Robul', Unix System Administrator & Programmer @ sanatorium "Raduga", 
Sochi, Russia
http://www.brainbench.com/transcript.jsp?pid=304744



Re: [GENERAL] plz, Help!! HOW CAN I GET THE ROWNUM IN POSTGRES TABLE AS I DID WITH ORACLE!!

2000-11-23 Thread GH

On Fri, Nov 24, 2000 at 08:35:34AM +0300, some SMTP stream spewed forth: 
> On Mon, Nov 20, 2000 at 12:44:20PM +0800, BaiJie wrote:
> > I KNOW THERE IS A OID FIELD ,BUT IT 'S WIRED , NOT A INTEGER INDEX FROM I TO
> > CURRENT ROW NUMBER!! HOW CAN I GET THE TRUE ROW NUMBER IN POSTGRESQL!!
> At first, don't use all caps. 

Heh, I was waiting for something like that.

> 
> -- 
> Igor' Robul', Unix System Administrator & Programmer @ sanatorium "Raduga", 
> Sochi, Russia
> http://www.brainbench.com/transcript.jsp?pid=304744



Re: [GENERAL] plz, Help!! HOW CAN I GET THE ROWNUM IN POSTGRES TABLE AS I DID WITH ORACLE!!

2000-11-23 Thread Igor' Robul'

On Fri, Nov 24, 2000 at 08:35:34AM +0300, Igor' Robul' wrote:
> On Mon, Nov 20, 2000 at 12:44:20PM +0800, BaiJie wrote:
> > I KNOW THERE IS A OID FIELD ,BUT IT 'S WIRED , NOT A INTEGER INDEX FROM I TO
> > CURRENT ROW NUMBER!! HOW CAN I GET THE TRUE ROW NUMBER IN POSTGRESQL!!
> At first, don't use all caps. 
And then, take any book about relation DBMS and read, that "row number" 
is not applicable for relations, because in general two 
SELECT * FROM rel;
may return rows in different order. And there no other way get records
from relation except SELECT :-)
So, if your algorithm needs "row numbers" redesign it. Or use
MS-Access or FoxPro.

-- 
Igor' Robul', Unix System Administrator & Programmer @ sanatorium "Raduga", 
Sochi, Russia
http://www.brainbench.com/transcript.jsp?pid=304744



Re: [GENERAL] selecting data from multiple DBs

2000-11-23 Thread DaVinci

On Fri, Nov 24, 2000 at 01:32:38AM +0100, Giovanni Tummarello wrote:
> Hello .. on the same machine i have several DBs.. i owuld like to do a query 
> that joins results from different ones .. is ther eany way to do it in 
> postgres?

 It is in the TODO list. Take a look ;)

 Greets.

David



[GENERAL] [NOVICE] Skipping numbers in a sequence.

2000-11-23 Thread GH

Hello all.

It's like this. ;-)

I have a table with a column that has a default nextval('sequence').
The sequence is a standard increment 1 cycle sequence.

What happens when
the sequence wraps after inserting the 
2-million-and-whatever-th row 
some of the earlier 
rows (say, 1-100) are still in the table
but other rows or sections (say, 101-110 and 120-125) have 
been deleted
and I need to begin with the first un-used sequence number?

I suppose that I would need to find the first un-used sequence number, 
use setval() to update the sequence, and then insert the row that needs
to be insert-ed. Well, how can I find the first un-used sequence number?
I thought about doing something using a function like
select sequence_column from table
NOT [the set of numbers that make up the sequence]
but, how do I select the set of numbers that make up the sequence?

Is there a better/cleaner/easier way of getting the end result?

Postgres 7.0.2 (should be running .3, *sigh*)
FreeBSD 4.1-RELEASE
PHP 4.0.3pl1

Thanks fellas (and ladies, if applicable).

gh




Re: [GENERAL] can't get user authentication to work - HELP!

2000-11-23 Thread Peter Eisentraut

Floyd Shackelford writes:

> i created a user using createuser named "user1" with password "password1"
> my pg_hba.conf file has the following entry:
> host all  192.168.1.0   255.255.255.0  password pg_passwd

> i try the following:
> psql -h 192.168.1.200 -d a_database -U user1 -W
> and i enter "password1" (sans quotes) at the password prompt and get:
> psql: FATAL 1:  SetUserId: user 'user1' is not in 'pg_shadow'
> 
> How do I get this to work? How do i get an entry into pg_shadow?

Normally you get one with createuser.  Perhaps you have two different
postmasters running and the createuser command picked the wrong one?

> psql -h 192.168.1.200 -d a_database -U postgres -W
> and I get:
> psql: Password authentication failed for user 'postgres'

By default the postgres user doesn't have a password.  You need to give it
one first. (See ALTER USER.)

-- 
Peter Eisentraut  [EMAIL PROTECTED]   http://yi.org/peter-e/




Re: [GENERAL] Running several postmaster using same database inparallel

2000-11-23 Thread Peter Eisentraut

Steffen Schmidt writes:

> I'am running several postmaster on different machines, accessing the
> same database in parallel. Is this a good idea?

Not at all.  In fact, version 7.0 and later won't even let you do this any
more.  Earlier versions where not so careful.

-- 
Peter Eisentraut  [EMAIL PROTECTED]   http://yi.org/peter-e/




Re: [GENERAL] Running several postmaster using same database inparallel

2000-11-23 Thread Peter Eisentraut

Steffen Schmidt writes:

> > > I'am running several postmaster on different machines, accessing the
> > > same database in parallel. Is this a good idea?
> > 
> > Not at all.  In fact, version 7.0 and later won't even let you do this any
> > more.  Earlier versions where not so careful.
> 
> Well, I am running postmasters in parallel using postgres-7.0.2. So
> postgres let me do this...???

Well, since you are running on separate hosts the postmaster you start up
second will find the pid lock file, determine that there's no process with
that pid (on its machine) and delete it.  So I guess you can do it, but
that still doesn't mean that your data is going to survive this.

-- 
Peter Eisentraut  [EMAIL PROTECTED]   http://yi.org/peter-e/




Re: [GENERAL] pgaccess

2000-11-23 Thread Peter Eisentraut

Olivier Cherrier writes:

> I would like to use pgaccess with a developpement server.
> I red the page "http://www.postgresql.org/docs/admin/x377.htm" but 
> didn't understand if I have to include the both "--with-tcl" and 
> "--with-x" on the server in the compilation. (The server is a BSD-i386)

That document is not correct.  --with-tcl is enough.

> Thus, I have no X-server on its. Is it a problem ?

If you don't have an X server then you're going to have a pretty tough
time running graphical applications such as pgaccess.  Not sure what you
mean with "Thus ...", perhaps there's a misunderstanding.

> By the way, what do I need on the client side to use pgaccess ?

Tcl/Tk

-- 
Peter Eisentraut  [EMAIL PROTECTED]   http://yi.org/peter-e/




[GENERAL] Enum type emulation: problem with opaque type in PL/pgSQL functions

2000-11-23 Thread Max Fonin

Guys, hello.

Here is a problem.

--
-- Creating 2 new functions and new type
--
BEGIN;

CREATE FUNCTION enum_week_in (opaque)
RETURNS int2
AS '
DECLARE
invalue ALIAS for $1;
BEGIN
IF invalue= OR invalue=''0'' THEN RETURN 0; END IF;
IF invalue=''Monday'' OR invalue=''1'' THEN RETURN 1; END IF;
IF invalue=''Tuesday'' OR invalue=''2'' THEN RETURN 2; END IF;
IF invalue=''Wednesday'' OR invalue=''3'' THEN RETURN 3; END IF;
RAISE EXCEPTION ''incorrect input value: %'',invalue;
END;'
LANGUAGE 'plpgsql'
WITH (ISCACHABLE);

CREATE FUNCTION enum_week_out (opaque)
RETURNS text
AS '
DECLARE
outvalue ALIAS for $1;
BEGIN
IF outvalue=0 THEN RETURN ; END IF;
IF outvalue=1 THEN RETURN ''Monday''; END IF;
IF outvalue=2 THEN RETURN ''Tuesday''; END IF;
IF outvalue=3 THEN RETURN ''Wednesday''; END IF;
RAISE EXCEPTION ''incorrect output value: %'',outvalue;
END;'
LANGUAGE 'plpgsql'
WITH (ISCACHABLE);

CREATE TYPE enum_week (
internallength = 2,
input = enum_week_in,
output = enum_week_out,
PASSEDBYVALUE
);

COMMIT;

Well, all is ok after it, e.g. functions and type were registered in system catalog.

Now, when I try to do "SELECT enum_week_in('Monday')", I get the following:

NOTICE: plpgsql: ERROR during compile of enum_week_in near line 0

The same will occure if I

CREATE TABLE test (wday enum_week);
insert into test (wday) values ('Monday')

If I redefine the same functions with input argtype 'text'/'int2' they work fine.
I guess the problem is that PL/pgSQL doesn't handle opaque type correctly.

Any ideas ?

I don't care how but I need to emulate ENUM type, just to convert MySQL dumps to 
PostgreSQL. E.g. ENUM values 
stored in MySQL dump should be restorable in Postgres without any conversion.

I running PostgreSQL 7.0.3 on Linux RedHat 6.2, kernel 2.2.15, Intel Celeron CPU; 
Postgres was 
upgraded from 7.0.2 without changing anything in system catalog.

Thanks,
Max Rudensky.