Re: [GENERAL] Problem with pg_log file corrupted

2001-04-25 Thread YekFu . Wong
-- Forwarded by YekFu Wong on 04/26/2001 02:27 PM --- YekFu Wong 04/26/2001 07:26 AM To: "Tom Lane" <[EMAIL PROTECTED]> @ INTERNET cc: Subject: Re: [GENERAL] Problem with pg_log file corrupted (Document link: YekFu Wong) I am using postgr

Re: [GENERAL] Problem with pg_log file corrupted

2001-04-25 Thread Tom Lane
[EMAIL PROTECTED] writes: > The error message appear when I tried to list all tables is as below : > " cannot flush block 8 of pg_log to stable store " I can't see any good reason why you'd get a failure there ... unless maybe you are out of disk space? Assuming you are running a 7.0.* release,

[GENERAL] Problem with pg_log file corrupted

2001-04-25 Thread YekFu . Wong
Hi, I think the pg_log file of my postgreSQL is corrupted after a power failure. I can;t access to tables in my database now. The error message appear when I tried to list all tables is as below : " cannot flush block 8 of pg_log to stable store " Anybody know how can I restore back the pg_log fi

Re: [GENERAL] CREATE TABLE AS... syntax?

2001-04-25 Thread Len Morgan
>CREATE TABLE foo (test INT4) AS SELECT number FROM account; I think you want something like: SELECT number INTO TABLE foo FROM account ; len morgan ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

[GENERAL] CREATE TABLE AS... syntax?

2001-04-25 Thread Dr. Evil
I'm trying to use CREATE TABLE AS under 7.03. There are no examples in the guide, so I tried a few things: CREATE TABLE foo (test INT4) AS SELECT number FROM account; and CREATE TABLE foo (test INT4) AS number FROM account; and both of them give ERROR: parser: parse error at or near "as".

Re: [GENERAL] Newbie struggling to set $PGDATA

2001-04-25 Thread Oliver Elphick
Geoff Caplan wrote: >Please help out a Linx/Postgres newbie. > >I simply want to set the $PGDATA environmental variable, but can't >figure out how. The docs assume you already know... > >I have tried setting it in my bash /etc/profile configuration file, >and it shows up ok if I "e

Re: [GENERAL] playing with timestamp entries

2001-04-25 Thread Dale Walker
Tom Lane wrote: > > Dale Walker <[EMAIL PROTECTED]> writes: > > I use the 'hash' type as queries regarding usage will always be of the > > form "select .. where username='xxx';" > > Use a btree anyway. Postgres' btree implementation is much better than > its hash index implementation. > O

Re: [GENERAL] playing with timestamp entries

2001-04-25 Thread Tom Lane
Dale Walker <[EMAIL PROTECTED]> writes: > I use the 'hash' type as queries regarding usage will always be of the > form "select .. where username='xxx';" Use a btree anyway. Postgres' btree implementation is much better than its hash index implementation. > insert into sumlog > selec

Re: [GENERAL] Joined table view - multiple delete action rule

2001-04-25 Thread Gyozo Papp
Hello, I came up against the same (or similar) difficulty some month ago. Then Tom Lane suggested me to write a simple sql or plpgsql function which handles the multiple delete action. (BTW, maybe you don't want to use the on delete cascade referential integrity in some cases.) Sorry, but I ca

[GENERAL] playing with timestamp entries

2001-04-25 Thread Dale Walker
I record our radius logs in a firly basic table, schema is as follows: -- CREATE TABLE "history_new" ( "username" character varying(50) NOT NULL, "time_stamp" int4 NOT NULL, "acctstatustype" character varying(8) NOT

[GENERAL] Re: Performance: sql functions v. plpgsql v. plperl

2001-04-25 Thread Tom Lane
Joel Burton <[EMAIL PROTECTED]> writes: > couldn't the parse tree be cached from this for each backend? Yes, if someone wanted to work on it ... regards, tom lane ---(end of broadcast)--- TIP 1: subscribe and unsubscribe co

[GENERAL] Re: Performance: sql functions v. plpgsql v. plperl

2001-04-25 Thread Joel Burton
On Wed, 25 Apr 2001, Tom Lane wrote: > Joel Burton <[EMAIL PROTECTED]> writes: > > Last night, I was doing some amateurish benchmarking and found that, > > contrary to my (admittedly uninformed) expectation, sql functions seem > > *slower* than plsql functions. > > IIRC, sql functions are re-par

Re: [GENERAL] SUM()ming a view's column

2001-04-25 Thread Jan Ploski
On Wed, Apr 25, 2001 at 12:52:15PM -0400, Tom Lane wrote: > Jan Ploski <[EMAIL PROTECTED]> writes: > > Here, v_wutest is a view which returns two rows. Shouldn't the SUM > > aggregate simply add these two values? To me, it looks like a bug. > > Does the view contain GROUP BY? If so, yes this is

[GENERAL] Re: indices are crashed after installation of rpm

2001-04-25 Thread J.H.M. Dassen (Ray)
Peter Keller <[EMAIL PROTECTED]> wrote: >we are running PostgreSQL 7.0.2 on Solaris 2.6,/x86 compiled by gcc 2.8.1. There are at least two components in this you might consider upgrading: - PostgreSQL itself (to 7.0.3 or, even better, 7.1) - gcc. Gcc 2.8.1 was a bit of a dead end in gcc developme

[GENERAL] Translations of PostgreSQL: Introduction and Concepts

2001-04-25 Thread Bruce Momjian
FYI, my book is being translated into Japanese and German. Local publishers will be printing the translations with permission from Addison-Wesley. I hope the translations can be made available online like the English version. Also, my book has been reviewed at: http://Linuxiso.org/book

Re: [GENERAL] Question on Bizarre Sorting (ORDER BY in 7.1) (fwd)

2001-04-25 Thread Barry Lind
The behavior seen here seems correct although not intuitive. My guess is that your database executables where created with locale support enabled and your database was inited with a US locale. The sorting logic for the english locales only sort on alpha-numeric characters. All other charac

Re: [GENERAL] Joined table view - multiple delete action rule

2001-04-25 Thread Lieven Van Acker
Hi Jan and others, thanks for the answer, this clears up the symptom. In trying to rewrite the rules, I'm still facing the same problem. I'll try to simplify the rules and tables (it's emulating the OO concept as a is the parent and b and c are inherited from a) CREATE TABLE a (x integer PRIMAR

Re: [GENERAL] SUM()ming a view's column

2001-04-25 Thread Tom Lane
Jan Ploski <[EMAIL PROTECTED]> writes: > Here, v_wutest is a view which returns two rows. Shouldn't the SUM > aggregate simply add these two values? To me, it looks like a bug. Does the view contain GROUP BY? If so, yes this is broken in pre-7.1 releases ... regards, tom

Re: [GENERAL]

2001-04-25 Thread Matthew Hixson
On Wed, 25 Apr 2001, Ashley T. Howes wrote: > I was wondering if PostgreSQL takes advantage of multiple CPUs when > placed in a single Linux box. Or are multiple CPUs utilised as long > as the Linux kernel is compiled to take advantage of them? If you compile an SMP kernel Linux will balance

Re: [GENERAL] Question on Bizarre Sorting (ORDER BY in 7.1)

2001-04-25 Thread Tom Lane
<[EMAIL PROTECTED]> writes: > I was interested in knowing whether or not this > is a bug, a change in the way PostgreSQL sorts, or possibly some kind of > locale-specific misconfiguration? There is not any (intentional) change in sorting behavior between 7.1 and earlier releases; indeed, since th

[GENERAL] Newbie struggling to set $PGDATA

2001-04-25 Thread Geoff Caplan
Hello Steve, Thursday, April 19, 2001, 4:53:58 PM, you wrote: SW> I just upgraded from 7.0.3 to 7.1 (using the RH rpms) with no SW> major problems. Nice! SW> However, I'm getting some strange behaviour from the init SW> script (/etc/rc.d/init.d/postgresql). In particular, a SW> restart whe

Re: [GENERAL] I can not create Index on a feild by type 'timestmp'!

2001-04-25 Thread Tom Lane
Hasan Mokhtari Sangchi <[EMAIL PROTECTED]> writes: > If I want to create an index on a field by type 'timestamp' > postgres give me following error message : > ' can not find a default operator class for type 1296.' > what can I do ? Upgrade to a more recent version of Postgres. Or, chang

Re: [GENERAL] SUM()ming a view's column

2001-04-25 Thread Jan Ploski
On Wed, Apr 25, 2001 at 04:26:14PM +0200, Jan Ploski wrote: > Hello, > > I have run into the following problem: > > workunit=> select * from v_wutest; > estimate > -- > 1650 > 100 > (2 rows) > > workunit=> select sum(estimate) from v_wutest; > sum > -- > 4950 > 10

Re: [GENERAL] Newbie struggling to set $PGDATA

2001-04-25 Thread Tom Lane
Geoff Caplan <[EMAIL PROTECTED]> writes: > I have tried setting it in my bash /etc/profile configuration file, > and it shows up ok if I "echo $PGDATA" in the shell. But none of the > postgres utilities such as "initdb" seem to be able to find it. You probably forgot to say "export PGDATA"; witho

Re: [GENERAL] Joined table view - multiple delete action rule

2001-04-25 Thread Jan Wieck
Lieven Van Acker wrote: > Hi Jan and others, > > thanks for the answer, this clears up the symptom. > > In trying to rewrite the rules, I'm still facing the same problem. > I'll try to simplify the rules and tables (it's emulating the OO concept as > a is the parent and b and c are inherited from

Re: [GENERAL] Joined table view - multiple delete action rule

2001-04-25 Thread Lieven Van Acker
Hi Andrew, I'm sorry but I was a but sloppy in typing. The right version is CREATE TABLE a (x integer PRIMARY KEY,y integer); CREATE TABLE b (x integer REFERENCES a, z integer, PRIMARY KEY (x,z)) CREATE VIEW ab AS SELECT a.x, a.y, b.z FROM a,b WHERE a.x=b.x; /* this -insert- seems

Re: [GENERAL] append all columns in where-clause

2001-04-25 Thread Tom Lane
will trillich <[EMAIL PROTECTED]> writes: > "how can we cast 'varchar' to 'bpchar' or vice-versa?" You just do it: select bpcharfld::varchar ... or whatever. regards, tom lane ---(end of broadcast)--- TIP 2: