Re: [GENERAL] Bug in PostgreSQL JDBC Drive.

2001-03-29 Thread Peter Mount

At 09:43 16/03/01 -0500, Raymond Chui wrote:

Delayed as I only read General once in a while - jdbc mails should go to 
the jdbc list.

>I have PostgreSQL jdbc7.0-1.2.jar JDBC drive.
>
>I found out if a column of a table is Timestamp data type
>
>Properties p = new Properties();
>p.put("PGTZ", "GMT");
>
>This does not take effect when you do
>SELECT/UPDATE/INSERT/DELETE (QUID).
>It gives me the local time zone.
>
>This should be the same as set environment
>"export PGTZ=GMT" or "setenv PGTZ GMT"
>in UNIX, right?

Nope... PGTZ is a libpq thing, and jdbc has nothing to do with libpq.


>I have to do
>connection = driver.connect('myjdbcURL", p);
>Statement st = connection.createStatement();
>st.execute("SET TIME ZONE 'GMT'");

Correct method.


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]



[GENERAL] Re: stored procedure and timestamp

2001-03-29 Thread Karel Zak


On Wed, Mar 28, 2001 at 04:13:19PM -0800, Soma Interesting wrote:
> I have the following trigger/stored procedure:
> 
> CREATE FUNCTION memb_num () RETURNS opaque AS '
>  BEGIN
>  NEW.member_num := date_part(''epoch'', timestamp ''now'');
^^

> "Cannot insert a duplicate key into unique index members_member_num_key"


 From docs:

   It is quite important to realize that CURRENT_TIMESTAMP and related
   functions all return the time as of the start of the current transaction;
   their values do not increment while a transaction is running. But
   timeofday() returns the actual current time.


 CURRENT_TIMESTAMP = now() = timestamp 'now'


Karel



-- 
 Karel Zak  <[EMAIL PROTECTED]>
 http://home.zf.jcu.cz/~zakkr/
 
 C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz

---(end of broadcast)---
TIP 6: Have you searched our list archives?

http://www.postgresql.org/search.mpl



Re: [GENERAL] fastpath error?

2001-03-29 Thread Peter Mount

At 07:56 28/03/01 -0500, chris markiewicz wrote:
>Hello.
>
>I am occasionally (seemingly randomly) seeing the following error when I try
>to load a large object.
>
>FastPath call returned ERROR:  lo_close: invalid large obj descriptor (0)

You must setAutoCommit(false) before using any large object.

Can someone give me some insight on this?  Can I call lo_close explicitly if
>i get this error?  Can I ignore it or will that leave me with open
>resources?

There are no open resources at the time of the error. Because lo's need to 
be within a transaction when the transaction closes, so do the lo's.

Peter


---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster



Re: [GENERAL] how to load a sql-file????

2001-03-29 Thread Marek Pętlicki

On Wednesday, March, 2001-03-28 at 16:55:55, will trillich wrote:
> On Thu, Mar 29, 2001 at 12:17:31AM +0200, Marek Pętlicki wrote:
> > On Tuesday, March, 2001-03-27 at 21:42:39, markus jais wrote:
> > > 
> > > in MySQL I can type something like in Bash on my linux box:
> > > 
> > > $ mysql -u root -p < file.sql
> > > 
> > > then the file file.sql is read.
> > > 
> > > can you tell me how to do this with postgresql???
> > > thanks a lot.
> > 
> > very similar:
> > 
> > psql dbname username < file.sql
> > 
> > should work
> > 
> > (you can well omit username if it is the same as your login name)
> 
> if your sql is flawless, go right ahead.
> 
> since psql reads " line numbers to help you track down troubles. (as far as it's
> concerned, you're just typing ral fast, so the feedback would
> occur right as you type, so line numbers would be superfluous.)
> 
> on the other hand, both
> 
>   psql -f file-containing-sql mydb
> 
> and
> 
>   psql mydb
>   mydb=> \i file-containing-sql
> 
> will spit out error messages including line numbers to help you
> debug your sql.

off course, but note that the question was if one could use '< file.sql'

It is the same mechanism as issuing:

my_program_creating_sql | psql dbname username

(for example to use compressed dump to restore without decompressing it
to the disk first) which can't be done with -f option ;-)

Nevertheless your remark about debugging errors in sql files is very
important...

regards

-- 
Marek Pętlicki <[EMAIL PROTECTED]>


---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



[GENERAL] tables, where

2001-03-29 Thread Martín Marqués

Hi
Is it a bad idea to put tables of different aplications, even if they have 
somethings in comun, in the same database?

Saludos... :-)

-- 
El mejor sistema operativo es aquel que te da de comer.
Cuida tu dieta.
-
Martin Marques  |[EMAIL PROTECTED]
Programador, Administrador  |   Centro de Telematica
   Universidad Nacional
del Litoral
-

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster



Re: [GENERAL] Determine Time in other Time Zone

2001-03-29 Thread Russell Hires

Upon further review... :-) 

I had a look at the ntp website, and there is a bunch of links at the
bottom. http://www.eecis.udel.edu/~ntp/ is the main ntp page.

http://www.bsdi.com/date/date?PRC is pretty interesting. It appears that
someone has already figured out the time in the various timezones! How you
could link this into a database I don't know...Maybe you could add an entry
for each user that would incorporate their location based on the list on
that web page.

I then went a-lookin' for more info on this. www.timezoneconverter.com was
looking interesting. It contains cgi-bin info (unforunately, hidden from
view). There was also a list of routines at ftp://elsie.nci.nih.gov/pub/ and
instructions at http://sandbox.xerox.com/stewart/tzconvert.cgi/info#help

Okay, enough research (Phew! I'm tired...). Is any of this useful? How could
it be incorporated into PSQL? I assume it's possible to call outside
routines from PSQL.

Hope this helps,

Russell


  _its_ (no apostrophe) means "the thing that it owns"
  _it's_ (with apostrophe) means "it is"


--
>From: Doug McNaught <[EMAIL PROTECTED]>
>To: "Russell Hires" <[EMAIL PROTECTED]>
>Cc: will trillich <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
>Subject: Re: [GENERAL] Determine Time in other Time Zone
>Date: Wed, Mar 28, 2001, 10:12 PM
>

> "Russell Hires" <[EMAIL PROTECTED]> writes:
>
>> Second, perhaps this sort of problem has been solved via the ntp software?
>> ntp polls various time servers. Perhaps there is a way to call a timeserver
>> that is local to where ever the users are logging in from.
>
> NTP keeps time in UTC.  Translation into local time is the
> responsibility of the client.  So that won't help much.
>
> Translating times between time zones is a hard problem.  One thing to
> look at is the timezone code that is shipped with free Unices
> (BSD/Linux) as it comes with a database of timezones with their
> offsets and DST rules.
>
> -Doug
>
> ---(end of broadcast)---
> TIP 6: Have you searched our list archives?
>
> http://www.postgresql.org/search.mpl

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster



[GENERAL] VARCHAR and TEXT

2001-03-29 Thread Paolo Sinigaglia

Hi everybody,
I have a little question about string types in PostgreSQL: it seems I don't
understood well how string data are stored in the database, from a recent
post by Tom Lane I feel encouraged to think that VARCHAR and TEXT are
treated the same way by PG, i.e. they occupy ony the space needed by their
actual length, bt I'm not so sure of it.

I ask this because I'm trying using PG as database server in a project
developed in delphi under ms-win and it seems to me that varchar and text
fields are not treated the same way by odbc interface and/or bde (borland
database engine, the database interface layer used by delphi programs). When
I connect to a table the fields of type VARCHAR are seen as strings while
the fields of type TEXT are seen as blobs, and this is a little upsetting,
because some useful functions are not implemented for blob fields.

I have several tables with fields that could contain quite lengthy strings,
but usually don't. So I don't want to define theese fields as VARCHAR(400)
if this means a disk occupation of 400 bye or so for each row (I have some
50 rows in a table and the average length of the field in question is
about 30, but the max length is near 400).

Can someone clarify this point?

Thanks in advance

___PS


---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly



Re: Fwd: Re: [GENERAL] timestamp/function question

2001-03-29 Thread will trillich

On Wed, Mar 28, 2001 at 11:46:42PM -0800, Soma Interesting wrote:
> 
> >blah blah blah 
> >
> >...and that all meant what? The postgres manual is open to much 
> >interpretation to anyone new trying to understand its contents. Combine 
> >that with documentation that's still not written, or broken across several 
> >different sections (programmer, user, admin, etc) and a search engine 
> >which returns absolute crap well I guess us new users can just go use 
> >MySQL.
> >
> >as far as I can tell the above sounds like a complicated  work-around to a 
> >bug, but maybe you'll be kind enough to correct me on this...?
> 
> BETTER YET!
> 
> edit my example code so it works and post it to this list so everyone else 
> can have a function that uses ''now'' as actually "this very moment in 
> time", rather than "the moment the main parser made 'now' a constant".
> 
> Yeesh!

try

\df time

and see what's available. notably,

select timeofday(),timenow();

-- 
does a brain cell think?

[EMAIL PROTECTED]
http://sourceforge.net/projects/newbiedoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



[GENERAL] ExecSQL NullPtrEx...conn timeout?

2001-03-29 Thread chris markiewicz

i am seeing NullPtrExs with the following stack trace:

java.lang.NullPointerException
at org.postgresql.Connection.ExecSQL(Connection.java:312)
at org.postgresql.jdbc2.Connection.commit(Connection.java:173)
at
com.commnav.sbh.framework.persist.JDBCConnection.disconnect(JDBCConnection.j
ava:416)
at
com.commnav.sbh.framework.persist.ConnectionPoolImpl.expire(ConnectionPoolIm
pl.java:245)
at com.commnav.sbh.framework.ObjectPool.clean(ObjectPool.java:178)
at com.commnav.sbh.framework.ObjectPool.run(ObjectPool.java:330)
at java.lang.Thread.run(Thread.java:484)

Our object pool disconnects unused open connections every few minutes.  Do
the connections themselves timeout?  is this a parameter somewhere?  I am
wondering if I am trying to close a connection that is already closed?

please respond directly to me - i'm not in the jdbc group.

thanks
chris


---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



Re: [GENERAL] timestamp/function question

2001-03-29 Thread Tom Lane

Soma Interesting <[EMAIL PROTECTED]> writes:
> Why does the following code return the exact same value each time, instead 
> of a value based on the current time?

> CREATE FUNCTION memb_num () RETURNS INT4 AS '
>   BEGIN
>   RETURN date_part(''epoch'', CURRENT_DATE);
>   END;
> ' LANGUAGE 'plpgsql';

Because you asked for a value based on the current *date*.
If you waited till tomorrow and tried again, then you'd get a
different answer.  Perhaps you want

RETURN date_part(''epoch'', CURRENT_TIMESTAMP);

regards, tom lane

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly



Re: [GENERAL] Pgsql-7.1RC1: SET SEED =

2001-03-29 Thread Tom Lane

Alexey Borzov <[EMAIL PROTECTED]> writes:
> The development docs state that one can use SET SEED to seed the
> random number generator

Where?  I see no such claim.  If there's something that leads you
to think that SET SEED and not setseed() is correct, then the docs
need to be fixed.

regards, tom lane

---(end of broadcast)---
TIP 6: Have you searched our list archives?

http://www.postgresql.org/search.mpl



Re: [GENERAL] explain shows lots-o-preliminary sorting

2001-03-29 Thread Chris Jones

On Wed, Mar 28, 2001 at 10:27:36PM -0600, will trillich wrote:

> more generally, what changes are possible to enhance performance
> of select queries? forcing indexes vs. seqential scans, using
> different joins that don't need sorting, etc. what's available?

You're not going to know what your queries' performance is until you
populate the database with plenty of data.  Look at the query plan
below, and notice the "rows" figures that are listed.  With 8 or 10
rows getting selected, it doesn't really matter which query plan gets
selected.

See the section on performance in the online PG manual.  It's on
www.postgresql.org, in the user's lounge.

The real trick is to create artificial data that's sufficiently
similar to real data that you can reliable measure performance with
it.

Chris

> > will trillich wrote:
> > > 
> > > psql=> explain select * from course;
> > > NOTICE:  QUERY PLAN:
> > > 
> > > Merge Join  (cost=4.14..4.42 rows=8 width=238)
> > >   ->  Sort  (cost=2.63..2.63 rows=5 width=60)
> > > ->  Merge Join  (cost=2.38..2.57 rows=5 width=60)
> > >   ->  Sort  (cost=1.30..1.30 rows=11 width=32)
> > > ->  Seq Scan on _topic  (cost=0.00..1.11 rows=11 width=32)
> > >   ->  Sort  (cost=1.08..1.08 rows=4 width=28)
> > > ->  Seq Scan on _edu  (cost=0.00..1.04 rows=4 width=28)
> > >   ->  Sort  (cost=1.52..1.52 rows=17 width=178)
> > > ->  Seq Scan on _course  (cost=0.00..1.17 rows=17 width=178)
> > > 
> > > EXPLAIN

-- 
[EMAIL PROTECTED] -
Chris JonesSRI International, Inc.
   www.sri.com

 PGP signature


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]



Re: [GENERAL] full table scan on 'select max(value) from table'?

2001-03-29 Thread Brent R. Matzelle

--- Sean Harding <[EMAIL PROTECTED]> wrote:
> I have a table, 'mesg_headers', which holds headers from email
> 
> messages. Each message has a unique integer ID within the
> system, 
> 'mesgid'. mesgid is the primary key for mesg_headers, so it
> has index
> mesg_headers_pkey. This index is used if I do 'select * from
> mesg_headers
> where mesgnum = whatever', but if I do 'select max(mesgnum)
> from
> mesg_headers', I get a full table scan, which takes a long
> time (there are
> currently over 370,000 rows). Explains:
> 
> email=# explain select * from mesg_headers where mesgnum =
> 100;
> NOTICE:  QUERY PLAN:
> 
> Index Scan using mesg_headers_pkey on mesg_headers 
> (cost=0.00..4.99 rows=1 width=92)
> 
> EXPLAIN
> email=# explain select max(mesgnum) from mesg_headers;
> NOTICE:  QUERY PLAN:
> 
> Aggregate  (cost=80319.44..80319.44 rows=1 width=4)
>   ->  Seq Scan on mesg_headers  (cost=0.00..79392.55
> rows=370755 width=4)
> 
> EXPLAIN
> 
> 
> So is there anything I can do about this, or will max(mesgnum)
> never use an
> index? I'm migrating this db from MySQL, where the same query
> returns almost
> instantanously, so some of my code makes the assumption that
> it's a cheap
> operation. I could work around it, but it would definitely be
> nicer to find
> a way to just make it use an index.

That functionality has been placed on the TODO list
(http://www.postgresql.org/docs/todo.html) under INDEXES.

Brent

__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/?.refer=text

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



Re: [GENERAL] Inserting possible dublicate unique keys

2001-03-29 Thread Alvar Freude

Hi,

Richard Huxton wrote:
> 
> > CREATE TABLE referer (
> >id SERIAL,
> >referer varchar(2048) NOT NULL PRIMARY KEY
> >);
[...]
> 
> Why have you got id as a serial if referer is your primary key? Oh - I
> suppose it's easier to reference a serial of course, less data to carry
> around.

oh, in reality the id is an int4 with unique index and nectval(...) ;-)


> The only thing I can think of is to insert into a staging table where
> referer isn't unique and insert into the real table from a snapshot of that
> staging table. Not sure that's a cleaner solution than yours though.

hm, but for this I have to change IDs in the Referencing Log-Table later



Now it works since two days on the production server with the solution
"try once again if error" and it seems it works good :-)


Ciao
  Alvar


-- 
AGI
Magirusstrasse 21B, 70469 Stuttgart
Fon +49 (0)711.228 74-50, Fax +49 (0)711.228 74-88
+++news+++news+++news+++
Beste Image-Website 2001 kommt von AGI
http://www.agi.de/tagebuch
http://www.agi.com/diary (english)

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



Re: [GENERAL] tables, where

2001-03-29 Thread Richard Huxton

From: "Martín Marqués" <[EMAIL PROTECTED]>

> Hi
> Is it a bad idea to put tables of different aplications, even if they have
> somethings in comun, in the same database?
>
> Saludos... :-)

Plus points :

+ If you need to join between tables you will *need* to do this

Minus points :

- You will need to make sure tables for application aa and bb don't have the
same name (so aa_contacts and bb_contacts)

- Security: make sure each application runs as a different user and only has
access to the tables is is supposed to.

- It is harder to back up individual applications' data

HTH

- Richard Huxton


---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly



Re: [GENERAL] VARCHAR and TEXT

2001-03-29 Thread Vilson farias

I gave up from using ODBC... to much problems with blobs and other stuff...
and really very low speed under Delphi. Try Zeos Database Components for
Postgre(http://www.marms.com/zeos). I've been using for 6 mounths and its
great. Blobs greater than 8Kb still are a big problem, but you will see this
component can recognize text fields as Memo and OIDs as Binary Blobs.

A really good point of these components is that you dont need BDE or ODBC
(everything is done accessing a single dll). My apps are very small and
installation is a piece of cake.

My config : Zeos 3.0.8 under Delphi 5 Enterprise.

Regards,

José Vilson de Mello de Farias
Dígitro Tecnologia Ltda - Brazil

- Original Message -
From: Paolo Sinigaglia <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Quinta-feira, 29 de Março de 2001 11:53
Subject: [GENERAL] VARCHAR and TEXT


: Hi everybody,
: I have a little question about string types in PostgreSQL: it seems I
don't
: understood well how string data are stored in the database, from a recent
: post by Tom Lane I feel encouraged to think that VARCHAR and TEXT are
: treated the same way by PG, i.e. they occupy ony the space needed by their
: actual length, bt I'm not so sure of it.
:
: I ask this because I'm trying using PG as database server in a project
: developed in delphi under ms-win and it seems to me that varchar and text
: fields are not treated the same way by odbc interface and/or bde (borland
: database engine, the database interface layer used by delphi programs).
When
: I connect to a table the fields of type VARCHAR are seen as strings while
: the fields of type TEXT are seen as blobs, and this is a little upsetting,
: because some useful functions are not implemented for blob fields.
:
: I have several tables with fields that could contain quite lengthy
strings,
: but usually don't. So I don't want to define theese fields as VARCHAR(400)
: if this means a disk occupation of 400 bye or so for each row (I have some
: 50 rows in a table and the average length of the field in question is
: about 30, but the max length is near 400).
:
: Can someone clarify this point?
:
: Thanks in advance
:
: ___PS
:
:
: ---(end of broadcast)---
: TIP 3: if posting/reading through Usenet, please send an appropriate
: subscribe-nomail command to [EMAIL PROTECTED] so that your
: message can get through to the mailing list cleanly
:


---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



Re: [GENERAL] Pgsql-7.1RC1: SET SEED =

2001-03-29 Thread Peter Eisentraut

Tom Lane writes:

> Alexey Borzov <[EMAIL PROTECTED]> writes:
> > The development docs state that one can use SET SEED to seed the
> > random number generator
>
> Where?  I see no such claim.  If there's something that leads you
> to think that SET SEED and not setseed() is correct, then the docs
> need to be fixed.

Actually, this used to work, but for some reason it's called 'set
random_seed' now.  I seem to be responsible for this, although I can't
imagine what the motivation might have been.  Should I change it back?

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


---(end of broadcast)---
TIP 6: Have you searched our list archives?

http://www.postgresql.org/search.mpl



Re: [GENERAL] Pgsql-7.1RC1: SET SEED =

2001-03-29 Thread Tom Lane

Peter Eisentraut <[EMAIL PROTECTED]> writes:
> Actually, this used to work, but for some reason it's called 'set
> random_seed' now.  I seem to be responsible for this, although I can't
> imagine what the motivation might have been.  Should I change it back?

If "set seed" worked in 7.0.* then I think we had better stick with that
spelling.  (Tries it ... yes it did.)  "random_seed" would be a better
name if we were working in a green field, but it's not enough better to
be worth breaking backwards compatibility for.

regards, tom lane

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



Re: [GENERAL] inconsistent functionality with LIKE operator

2001-03-29 Thread will trillich

On Thu, Mar 29, 2001 at 08:25:30AM +, Phuong Ma wrote:
> I'm using PostgreSQL version 7.1, and I'm having trouble with the LIKE
> statement.  How would I find the value "a\bc"?  I tried using the
> backslash to escape it: LIKE 'a\\b%';
> 
> If I specify: LIKE 'a\\bc', then it works, but if I wanted it to look
> for consecetive characters after the c, using the %, then it returns
> other values besides what I'm looking for.
> 
> I also have the same problem with percent (%).  I have a test string
> with the value "ab%c", and I want to look for that using LIKE.  I tried:
> LIKE 'ab\%c', LIKE 'ab%%', and LIKE 'ab\%_', but these statements not
> only returned what I was looking for, but also other values:
> "abc","ABC", and "Abc". 

with LIKE, '%' means "anything" just as /.*/ does in a perl
regex; and '_' means "any character" just as /./ does in perl.

by default.

you can change the escape char, tho --

http://google.com/search?as_q=like+select+escape&as_sitesearch=postgresql.org


-- 
does a brain cell think?

[EMAIL PROTECTED]
http://sourceforge.net/projects/newbiedoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!

---(end of broadcast)---
TIP 6: Have you searched our list archives?

http://www.postgresql.org/search.mpl



Re: [GENERAL] tables, where

2001-03-29 Thread Rich Shepard

On Thu, 29 Mar 2001, Richard Huxton wrote:

> From: "Martín Marqués" <[EMAIL PROTECTED]>
>
> > Is it a bad idea to put tables of different aplications, even if they have
> > somethings in comun, in the same database?
>
> Plus points :

> Minus points :

  As I have not received an answer to my posted question of a few days ago,
let me try again, under this thread. It's a related question.

  The docs for the 6.x releases described how to use different data
directories under postgres. After trying unsuccessfully with a number of
different approaches, I asked the list and learned that this feature was
broken under 6.x but was scheduled to be working in the 7.x releases. My
question is whether or not (with 7.0.3 or 7.1) I can specify environment
variables such as $PGDATA2 and $PGDATA3, each pointing to a project-specific
data directory, and be able to have postgres recognize (and accept!) that
directory?

  For example, (and this is what I tried with the 6.5.x series), in
~/.bash_profile I have this:

PGLIB=/usr/lib/pgsql
PGDATA=/var/lib/pgsql
PGDATA2=/home/rshepard/accounting/paisley
export PGLIB PGDATA PGDATA2

  I went through the process of registering PGDATA2 with postgres
(supposedly), but I could not use this directory.

  Could I now do this and have it work?

Thanks,

Rich

Dr. Richard B. Shepard, President

   Applied Ecosystem Services, Inc. (TM)
2404 SW 22nd Street | Troutdale, OR 97060-1247 | U.S.A.
 + 1 503-667-4517 (voice) | + 1 503-667-8863 (fax) | [EMAIL PROTECTED]


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]



[GENERAL] Re: database dirs very stange on solaris

2001-03-29 Thread Gregory Wood

You didn't mention which version either of those machines are running. I
believe in 7.1 Postgres the database filenames changed to a numerical
database id of some sort. Prior to that, they were named the same as the
database. I don't know the reasoning behind the switch, but I'm fairly sure
it was to make some future features easier to implement. Anyway, I suspect
that your Solaris machine is running a version of 7.1 (RC1?) while your
Linux box has 7.0.3?

Greg

> check this:
>
> On Solaris SPARC:
>
> postgres@bugs:/space/local/pgsql > ls -l data/base/
> total 15
> drwx--   2 postgres staff1536 Mar 29 10:57 1
> drwx--   2 postgres staff1536 Mar 29 10:10 18719
> drwx--   2 postgres staff1536 Mar 29 10:58 18723
> drwx--   2 postgres staff2048 Mar 29 10:58 18816
> drwx--   2 postgres staff1536 Mar 29 10:58 19057
> drwx--   2 postgres staff2560 Mar 29 10:58 19169
> drwx--   2 postgres staff1536 Mar 29 10:58 19941
> postgres@bugs:/space/local/pgsql > psql -l
> List of databases
>Database   |  Owner
> --+--
>  horde| postgres
>  lismarch | postgres
>  pruebas  | postgres
>  resoluciones | postgres
>  template0| postgres
>  template1| postgres
>  unl  | postgres
> (7 rows)
>
> postgres@bugs:/space/local/pgsql >
>
> On Linux/Intel:
>
> [postgres@math pgsql]$ ls -l data/base/
> total 14
> drwx--   2 postgres postgres 2048 Jan 29 12:16 horde
> drwx--   2 postgres postgres 3072 Feb 27 09:51 katedra
> drwx--   2 postgres postgres 3072 Feb 12 09:44 template1
> drwx--   2 postgres postgres 4096 Jan 25 18:49 tesis
> drwx--   2 postgres postgres 2048 Feb 12 19:01 test
> [postgres@math pgsql]$ psql -l
> List of databases
>  Database  |  Owner   | Encoding
> ---+--+---
>  horde | postgres | SQL_ASCII
>  katedra   | postgres | SQL_ASCII
>  template1 | postgres | SQL_ASCII
>  tesis | postgres | SQL_ASCII
>  test  | postgres | SQL_ASCII
> (5 rows)
>
> [postgres@math pgsql]$
>
> Why does solaris use that horrable denomination for the different
directories
> of the databases?
>
> Saludos... :-)
>
> --
> El mejor sistema operativo es aquel que te da de comer.
> Cuida tu dieta.
> -
> Martin Marques  |[EMAIL PROTECTED]
> Programador, Administrador  |   Centro de Telematica
>Universidad Nacional
> del Litoral
> -
>
> ---(end of broadcast)---
> TIP 6: Have you searched our list archives?
>
> http://www.postgresql.org/search.mpl
>


---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



[GENERAL] Re: function to operate on same fields, different records?

2001-03-29 Thread Gregory Wood

> SELECT sum(grade) / count(grade) As GPA FROM grades;
>  (bad juju if 0)

No kidding... that kid totally failed ALL his classes! And before someone
points it out, yes I saw the DBZ.

Greg


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]



[GENERAL] Re: Consistent pg_dump's

2001-03-29 Thread Gregory Wood

> > I am pretty sure that pg_dump produces a consistent snapshot, using
> > the same transaction isolation mechanism (MVCC) as the database
> > itself.  If one of the gurus posts and says otherwise, believe him,
> > not me.  ;)
>
> My impression from reading the source was that it was consitant per-table
> but not per-database.  Meaning you'd get a consistant snapshot of a table,
> but not of the entire system.
>
> I could be wrong though.

I hope so... that could break some foreign key dependencies pretty badly...

Greg


---(end of broadcast)---
TIP 6: Have you searched our list archives?

http://www.postgresql.org/search.mpl



[GENERAL] PostGreSQL 7.1

2001-03-29 Thread datactrl

Hi, All

Where can I get a PostGreSQL 7.1 lattest beta version with RPM installation?

JACK


---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html