Re: [HACKERS] FATAL: catalog is missing 1 attribute(s) for relid

2005-01-14 Thread Marc G. Fournier
On Thu, 13 Jan 2005, Tom Lane wrote:
Marc G. Fournier [EMAIL PROTECTED] writes:
What the client did was a 'delete from pg_attribute where ... ' ...
[ blink... ]  Well, that sort of thing is definitely a candidate for the
Darwin Award, but what exactly was the WHERE clause?
We were working on removing a 'botched' erserver install, to put slony 
into place, and he didn't realize the ramifications of modifying system 
files directly :(

I'm still searching the 'net to see if there is somethign that I've
overlooked ... but everything so far is drawing a deadend ... can someone
suggest a web page I should read, a tool I could use, or something, to get
the data out of this, that I'm not finding?  Or some way of 'fixing' relid
16396? :)
[ select 16396::regclass... ] pg_am?  You may be in luck, because that
is the one solitary system catalog that no one ever changes.  If that's
all that got hit you might have a chance.  What I'm wondering is just
exactly what the extent of the damage was.
'k, I can try that in the morning and see ...

Marc G. Fournier   Hub.Org Networking Services (http://www.hub.org)
Email: [EMAIL PROTECTED]   Yahoo!: yscrappy  ICQ: 7615664
---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings


Re: [HACKERS] Slow PL/pgSQL 8.0.RC5 (7.4.6. 3times faster)

2005-01-14 Thread Pavel Stehule
Hello, 

with IMMUTABLE or STABLE function is only 7% slowly. It can be usefull add 
into documentation so default flag is immutable, but if its not necessary 
its recommended IMMUTABLE or STABLE flag.

Regards
Pavel Stehule


---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings


[HACKERS] pgdump

2005-01-14 Thread Enrico
Is there anyone who written a patch for a multiple pg_dump like:
pg_dump -t table1 table2 ... tableN dbname
Regards Enrico

---(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: [HACKERS] pgdump

2005-01-14 Thread Andreas Joseph Krogh
On Friday 14 January 2005 11:45, Enrico wrote:
 Is there anyone who written a patch for a multiple pg_dump like:

 pg_dump -t table1 table2 ... tableN dbname

Yes, I have such a patch lying around(pg_dump -t table1 -t table2 ... dbname).

It's for 7.4, but shouldn't be hard to port to 8.0.

-- 
Andreas Joseph Krogh [EMAIL PROTECTED]
Senior Software Developer / Manager
gpg public_key: http://dev.officenet.no/~andreak/public_key.asc
+-+
OfficeNet AS| Can i wash my clothes with my dvd drive?|
Hoffsveien 17   | Or do i need to replace it with a washing   |
PO. Box 425 Skøyen  | machine??   |
0213 Oslo   | |
NORWAY  | |
Phone : +47 22 13 01 00 | |
Direct: +47 22 13 10 03 | |
Mobile: +47 909  56 963 | |
+-+


pgpEVfmcVbnTS.pgp
Description: PGP signature


Re: [HACKERS] pgdump

2005-01-14 Thread Enrico

Yes, I have such a patch lying around(pg_dump -t table1 -t table2 ... dbname).
It's for 7.4, but shouldn't be hard to port to 8.0.
 

Oh wonderful, how can I see that? I'm working with 7.4.x version.
Thanks Enrico
---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [HACKERS] pgdump

2005-01-14 Thread Enrico
yo mero wrote:
you can use this in  BASH:
for a in table1 table2 tableN
do
echo $a
pg_dump -t $a  dbname   $a.sql
done
works fine  

leonel
 

Yes I wrote that, but I wanted to know if is possible to do that without 
a bash script,

Regards Enrico
---(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


[HACKERS] Time span conversion function

2005-01-14 Thread Brendan Jurd
I've got an idea for a new internal function.  I'm more than willing to 
code it myself, but I'd like to run it past the list and thrash out any 
conceptual issues before I get too excited about writing a patch.

When dealing with time values, it's not unknown to want to see a 
particular time span (not the same as a postgres interval, see below) 
expressed in one particular time unit.  You might want to know how many 
months have passed since a certain date, or how many minutes between two 
events.  Postgres doesn't really have any functions to help out with 
this.  You can always develop workarounds to get the result, but IMO 
this would be more elegantly dealt with internally.

My proposed function, let's call it time_span for now, would take a unit 
of time as text (like date_part does), and two delimiting timestamps (or 
a timestamp and an interval).  The result would be the time span 
converted into the specified unit.  So for example:

 SELECT time_span( 'month', '2004-10-01', '2005-02-22' );
4
 SELECT time_span( 'minute', now(), interval '10:43:55' );
643
It may seem strange at first to be using two timestamps instead of a 
single interval value, but there's a reason for it.  A postgres interval 
is just a delta.  It does not refer to any point in time, only 
separate quantities of the various units.  Therefore it is impossible to 
convert between units that don't have consistent relationships (being 
day = month and day = year) without approximating.  By using two 
real timestamps, you can accurately convert the span into any of the 
available units.

You could make the function even more powerful by adding an optional 
fourth precision argument, which when given allows the function to 
return a fractional part.  Like so:

 SELECT time_span( 'month', '2004-10-01', '2005-02-22', 2 );
4.79
 SELECT time_span( 'minute', now(), interval '10:43:55', 4 );
643.9167
That about does it for my initial proposal.  Fire at will.
BJ
---(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: [HACKERS] pgdump

2005-01-14 Thread Andreas Joseph Krogh
On Friday 14 January 2005 14:54, Enrico wrote:
 Yes, I have such a patch lying around(pg_dump -t table1 -t table2 ...
  dbname).
 
 It's for 7.4, but shouldn't be hard to port to 8.0.

 Oh wonderful, how can I see that? I'm working with 7.4.x version.

Actually, it's for 7.4beta3, but should probably apply to 7.4 final as 
well

Here it is:

http://dev.officenet.no/~andreak/pg_dump.c.diff

-- 
Andreas Joseph Krogh [EMAIL PROTECTED]
Senior Software Developer / Manager
gpg public_key: http://dev.officenet.no/~andreak/public_key.asc
+-+
OfficeNet AS| Can i wash my clothes with my dvd drive?|
Hoffsveien 17   | Or do i need to replace it with a washing   |
PO. Box 425 Skøyen  | machine??   |
0213 Oslo   | |
NORWAY  | |
Phone : +47 22 13 01 00 | |
Direct: +47 22 13 10 03 | |
Mobile: +47 909  56 963 | |
+-+

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


Re: [HACKERS] pgdump

2005-01-14 Thread Enrico

Here it is:
http://dev.officenet.no/~andreak/pg_dump.c.diff
 

Many Thanks :)))
Enrico
---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
 joining column's datatypes do not match


Re: [HACKERS] IBM releases 500 patents

2005-01-14 Thread Bruno Wolff III
On Tue, Jan 11, 2005 at 10:33:44 -0800,
  Elein Mustain [EMAIL PROTECTED] wrote:
 They probaly released the informix database patents.
 This is pertinent to us as several of them were interesting
 implementations of things like the function manager.

From what I read of this, the way they released the patents isn't completely
compatible with BSD licenses.

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


Re: [HACKERS] IBM releases 500 patents

2005-01-14 Thread Calvin Sun
You can get the list of patents from here:

http://www-106.ibm.com/developerworks/blogs/dw_blog_comments.jspa?blog=384entry=69779


-Original Message-
From: Bruno Wolff III [mailto:[EMAIL PROTECTED]
Sent: Friday, January 14, 2005 10:29 AM
To: Elein Mustain
Cc: Darcy Buskermolen; pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] IBM releases 500 patents


On Tue, Jan 11, 2005 at 10:33:44 -0800,
  Elein Mustain [EMAIL PROTECTED] wrote:
 They probaly released the informix database patents.
 This is pertinent to us as several of them were interesting
 implementations of things like the function manager.

From what I read of this, the way they released the patents isn't completely
compatible with BSD licenses.

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

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


Re: [HACKERS] FATAL: catalog is missing 1 attribute(s) for relid

2005-01-14 Thread Marc G. Fournier
On Thu, 13 Jan 2005, Tom Lane wrote:
I'm still searching the 'net to see if there is somethign that I've
overlooked ... but everything so far is drawing a deadend ... can someone
suggest a web page I should read, a tool I could use, or something, to get
the data out of this, that I'm not finding?  Or some way of 'fixing' relid
16396? :)
[ select 16396::regclass... ] pg_am?  You may be in luck, because that
is the one solitary system catalog that no one ever changes.  If that's
all that got hit you might have a chance.  What I'm wondering is just
exactly what the extent of the damage was.
Nope, that doesn't work ... in fact, the 16396/pg_am table hadn't even 
been modified since Jun of last year ;(

If I rebuild pg_attribute based on the schema itself, and copy that into 
place, should that work?  Guess at this point in time, it can't hurt to 
try :)


Marc G. Fournier   Hub.Org Networking Services (http://www.hub.org)
Email: [EMAIL PROTECTED]   Yahoo!: yscrappy  ICQ: 7615664
---(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: [HACKERS] FATAL: catalog is missing 1 attribute(s) for relid

2005-01-14 Thread Marc G. Fournier
course that won't work, since its link'd to the oid of the table name :( 
whose idea was this let's name the files by the OID again? :(

On Fri, 14 Jan 2005, Marc G. Fournier wrote:
On Thu, 13 Jan 2005, Tom Lane wrote:
I'm still searching the 'net to see if there is somethign that I've
overlooked ... but everything so far is drawing a deadend ... can someone
suggest a web page I should read, a tool I could use, or something, to get
the data out of this, that I'm not finding?  Or some way of 'fixing' relid
16396? :)
[ select 16396::regclass... ] pg_am?  You may be in luck, because that
is the one solitary system catalog that no one ever changes.  If that's
all that got hit you might have a chance.  What I'm wondering is just
exactly what the extent of the damage was.
Nope, that doesn't work ... in fact, the 16396/pg_am table hadn't even been 
modified since Jun of last year ;(

If I rebuild pg_attribute based on the schema itself, and copy that into 
place, should that work?  Guess at this point in time, it can't hurt to try 
:)


Marc G. Fournier   Hub.Org Networking Services (http://www.hub.org)
Email: [EMAIL PROTECTED]   Yahoo!: yscrappy  ICQ: 7615664

Marc G. Fournier   Hub.Org Networking Services (http://www.hub.org)
Email: [EMAIL PROTECTED]   Yahoo!: yscrappy  ICQ: 7615664
---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
   (send unregister YourEmailAddressHere to [EMAIL PROTECTED])


Re: [HACKERS] FATAL: catalog is missing 1 attribute(s) for relid 16396

2005-01-14 Thread Tom Lane
Marc G. Fournier [EMAIL PROTECTED] writes:
 course that won't work, since its link'd to the oid of the table name :( 

Not to mention all the other system catalogs.  You could maybe make this
idea work by regenerating the entire catalog set, but not by
regenerating just pg_attribute.  But if you don't know the table-to-OID
mapping in the old database you're screwed anyway :-(

regards, tom lane

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


Re: [HACKERS] FATAL: catalog is missing 1 attribute(s) for relid

2005-01-14 Thread Marc G. Fournier
On Fri, 14 Jan 2005, Tom Lane wrote:
Marc G. Fournier [EMAIL PROTECTED] writes:
course that won't work, since its link'd to the oid of the table name :(
Not to mention all the other system catalogs.  You could maybe make this
idea work by regenerating the entire catalog set, but not by
regenerating just pg_attribute.  But if you don't know the table-to-OID
mapping in the old database you're screwed anyway :-(
Exactly ... and I take it there are no 'headers' in the files themselves 
to use for an association?  some way that they are tag'd?

Is there any way of 'raw dumping' pg_attribute itself, to find out the 
mappings?


Marc G. Fournier   Hub.Org Networking Services (http://www.hub.org)
Email: [EMAIL PROTECTED]   Yahoo!: yscrappy  ICQ: 7615664
---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [HACKERS] FATAL: catalog is missing 1 attribute(s) for relid 16396

2005-01-14 Thread Tom Lane
Marc G. Fournier [EMAIL PROTECTED] writes:
 course that won't work, since its link'd to the oid of the table name :( 
 whose idea was this let's name the files by the OID again? :(

Actually, I think you can make this work, if you are sure of the schema
of the old database.  Try something like this:

* Continue to work in the same installation; don't initdb.  If you did
initdb then old transaction numbers would be wrong.  Just create a new
database beside the old one (or maybe better, physically copy the old
one someplace and then drop and re-createdb it).

* Rebuild the schema.  Now you have a lot of empty tables and you just
have to get the old data into them.  That means you have to find out the
mapping from old table filenode numbers to new ones.

* To find out the old numbers, make a user table that has the identical
schema to pg_class (probably easiest to do this with the LIKE clause of
CREATE TABLE).  Check its relfilenode number in pg_class, then copy the
old database's pg_class file over that relfilenode.  Now you can query
this table to see the contents of the old pg_class.

* Join the new and old pg_class together to get corresponding
relfilenode numbers.

* Copy old table files into new database per the above.  (I'd make a
script to do this instead of doing it by hand...)  Also you'll need to
copy corresponding TOAST tables.  Don't copy indexes though.

* REINDEX all the indexes, and I think you're there.

It may take a couple tries to get this right, but as long as you made a
copy of the old database to start with, you can start over...

regards, tom lane

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

   http://archives.postgresql.org


Re: [HACKERS] FATAL: catalog is missing 1 attribute(s) for relid

2005-01-14 Thread Marc G. Fournier
On Fri, 14 Jan 2005, Tom Lane wrote:
Marc G. Fournier [EMAIL PROTECTED] writes:
course that won't work, since its link'd to the oid of the table name :(
whose idea was this let's name the files by the OID again? :(
Actually, I think you can make this work, if you are sure of the schema
of the old database.  Try something like this:
* Continue to work in the same installation; don't initdb.  If you did
initdb then old transaction numbers would be wrong.  Just create a new
database beside the old one (or maybe better, physically copy the old
one someplace and then drop and re-createdb it).
* Rebuild the schema.  Now you have a lot of empty tables and you just
have to get the old data into them.  That means you have to find out the
mapping from old table filenode numbers to new ones.
* To find out the old numbers, make a user table that has the identical
schema to pg_class (probably easiest to do this with the LIKE clause of
CREATE TABLE).  Check its relfilenode number in pg_class, then copy the
old database's pg_class file over that relfilenode.  Now you can query
this table to see the contents of the old pg_class.
* Join the new and old pg_class together to get corresponding
relfilenode numbers.
* Copy old table files into new database per the above.  (I'd make a
script to do this instead of doing it by hand...)  Also you'll need to
copy corresponding TOAST tables.  Don't copy indexes though.
'k, this is looking promising ... but I'm a bit confused on the TOAST 
tables ... I can't match on 'relname', since they aren't the same ... the 
old has, for instance:

pg_toast_5773565
while the new has:
pg_toast_8709712
is there some sort of 'linkage' in pg_class that I'm not seeing? since new 
is finding 21 rows, and old is only finding 20, I can't imagine its safe 
to assume that the 'order of creation' will be safe to match on ...

 
Marc G. Fournier   Hub.Org Networking Services (http://www.hub.org)
Email: [EMAIL PROTECTED]   Yahoo!: yscrappy  ICQ: 7615664
---(end of broadcast)---
TIP 6: Have you searched our list archives?
  http://archives.postgresql.org


Re: [HACKERS] FATAL: catalog is missing 1 attribute(s) for relid 16396

2005-01-14 Thread Tom Lane
Marc G. Fournier [EMAIL PROTECTED] writes:
 'k, this is looking promising ... but I'm a bit confused on the TOAST 
 tables ... I can't match on 'relname', since they aren't the same ... the 
 old has, for instance:

 pg_toast_5773565

 while the new has:

 pg_toast_8709712

 is there some sort of 'linkage' in pg_class that I'm not seeing?

Yeah.  A toast table's OID appears in the reltoastrelid field of its
owning table.  So you match new and old pg_class entries by name,
take their reltoastrelid fields, look up those rows by OID, and their
relfilenode fields give the names of the TOAST files.

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: [HACKERS] Time span conversion function

2005-01-14 Thread Kris Jurka


On Sat, 15 Jan 2005, Brendan Jurd wrote:

   SELECT time_span( 'minute', now(), interval '10:43:55' );
 643
 

The timestamp argument to this version of the function seems completely 
irrelevent.

Kris Jurka

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


Re: [HACKERS] sparse (static analyzer) report

2005-01-14 Thread Mark Wong
On Thu, Jan 13, 2005 at 03:09:19PM -0800, Mark Wong wrote:
 On Thu, Jan 13, 2005 at 08:06:23PM -0300, Alvaro Herrera wrote:
  On Thu, Jan 13, 2005 at 01:31:36PM -0800, Mark Wong wrote:
   We've also started automating sparse analyses in our PLM tool, which
   will show an error and warning count.  Here's an example:
 http://www.osdl.org/plm-cgi/plm?module=patch_infopatch_id=4065
  
  I took a peek at the first sparse report you posted, and it's too noisy
  to be useful.  The parser seems confused in several ways in thousands of
  places.
  
  Maybe there's something useful to be extracted, but we'd need to adapt
  sparse.
  
 
 It might not have helped to dump every source file's report into a
 single file.  Would it have helped to split out the results per file?
 

Something like this:
http://developer.osdl.org/markw/pgsql/sparse/pg-8.0rc5.html

Mark

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


Re: [HACKERS] sparse (static analyzer) report

2005-01-14 Thread Alvaro Herrera
On Fri, Jan 14, 2005 at 03:53:09PM -0800, Mark Wong wrote:
 On Thu, Jan 13, 2005 at 03:09:19PM -0800, Mark Wong wrote:
  On Thu, Jan 13, 2005 at 08:06:23PM -0300, Alvaro Herrera wrote:
   On Thu, Jan 13, 2005 at 01:31:36PM -0800, Mark Wong wrote:
We've also started automating sparse analyses in our PLM tool, which
will show an error and warning count.  Here's an example:

   http://developer.osdl.org/markw/pgsql/sparse/pg-8.0rc5.html

Hmm.  Well, it showed the multiple incorrect uses of 0 as NULL in
dllist.c and other places, but there's still lots of spurious entries.
See backend/transam/xlog.c: it's strange that the parser is so confused
about XLogCtrl, for example.

It's complaining in several places about function as variables in
function declarations (the multiple walkers and mutators for example);
not sure how correct that is.

It is also analyzing flex and bison output files ... is it capable of
analyzing .y and .l files instead?

It's strange that DatumGetInt32 shows as a undefined identifier ...
there's some problem with postgres.h apparently.  And fmgroids.h is
missing; not sure what's the minimal make target to install it, because
make -C src/backend/utils fmgroids.h
generates it, but the symbolic link to src/include/utils is still
needed.

-- 
Alvaro Herrera ([EMAIL PROTECTED])
La gente vulgar solo piensa en pasar el tiempo;
el que tiene talento, en aprovecharlo

---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings


Re: [HACKERS] sparse (static analyzer) report

2005-01-14 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes:
 ... And fmgroids.h is
 missing; not sure what's the minimal make target to install it, because
 make -C src/backend/utils fmgroids.h
 generates it, but the symbolic link to src/include/utils is still
 needed.

Looks like the symlinks are made in src/backend/Makefile.

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: [HACKERS] sparse (static analyzer) report

2005-01-14 Thread Mark Wong
On Fri, Jan 14, 2005 at 09:54:24PM -0300, Alvaro Herrera wrote:
 On Fri, Jan 14, 2005 at 03:53:09PM -0800, Mark Wong wrote:
  On Thu, Jan 13, 2005 at 03:09:19PM -0800, Mark Wong wrote:
   On Thu, Jan 13, 2005 at 08:06:23PM -0300, Alvaro Herrera wrote:
On Thu, Jan 13, 2005 at 01:31:36PM -0800, Mark Wong wrote:
 We've also started automating sparse analyses in our PLM tool, which
 will show an error and warning count.  Here's an example:
 
  http://developer.osdl.org/markw/pgsql/sparse/pg-8.0rc5.html
 
 Hmm.  Well, it showed the multiple incorrect uses of 0 as NULL in
 dllist.c and other places, but there's still lots of spurious entries.
 See backend/transam/xlog.c: it's strange that the parser is so confused
 about XLogCtrl, for example.

I'm sure there are a number of false positives, if that's what you're
getting at.

 It's complaining in several places about function as variables in
 function declarations (the multiple walkers and mutators for example);
 not sure how correct that is.
 
 It is also analyzing flex and bison output files ... is it capable of
 analyzing .y and .l files instead?

Yeah, I generate the file list to run sparse against with a
find . -name '*.c'.  So that's simple enough.  But flex and bison
files don't end in .c, do they?

 It's strange that DatumGetInt32 shows as a undefined identifier ...
 there's some problem with postgres.h apparently.  And fmgroids.h is
 missing; not sure what's the minimal make target to install it, because
 make -C src/backend/utils fmgroids.h
 generates it, but the symbolic link to src/include/utils is still
 needed.

Perhaps part of this has to do with my rather blind selection of files
to run sparse against.  For example, you still have to run configure
first and it probably doesn't make sense to run on some of the files
in ports.  I did notice one of the files complained about missing
Windows.h. :)

Mark

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


Re: [HACKERS] sparse (static analyzer) report

2005-01-14 Thread Neil Conway
BTW, perhaps one reason for the relatively small number of legitimate 
issues picked up by sparse is that I ran sparse on the tree a month or 
two ago and fixed some of the stylistic issues it reported. Most of the 
stuff I didn't bother to fix looked like either a sparse bug, or a 
marginal style improvement I didn't bother applying (like fixing 0 = 
NULL in dllist.c).

I've been meaning to investigate whether sparse can be used as something 
more than just a fussy syntax checker (i.e. whether it can do any 
meaningful static analysis for interesting properties), but I haven't 
had a chance yet.

Alvaro Herrera wrote:
It's complaining in several places about function as variables in
function declarations (the multiple walkers and mutators for example);
not sure how correct that is.
I believe the conclusion of prior discussions about making the 
walker/mutator prototypes more precise is that it's not worth the cost.

-Neil
P.S. Hope everyone had a good holiday. I'm back at work on Monday.
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
  http://www.postgresql.org/docs/faqs/FAQ.html


Re: [HACKERS] IBM releases 500 patents

2005-01-14 Thread Jim C. Nasby
On Fri, Jan 14, 2005 at 10:28:52AM -0600, Bruno Wolff III wrote:
 On Tue, Jan 11, 2005 at 10:33:44 -0800,
   Elein Mustain [EMAIL PROTECTED] wrote:
  They probaly released the informix database patents.
  This is pertinent to us as several of them were interesting
  implementations of things like the function manager.
 
 From what I read of this, the way they released the patents isn't completely
 compatible with BSD licenses.

Is the only concern the commercialized offerings of PostgreSQL? It seems
that commercial entities could either negotiate terms with IBM or help
maintain a 'patent-free' branch of PostgreSQL. Yes, sub-optimal and a
good amount of work, but depending on what's to be gained by utilizing
some of the patents it might still be better for PostgreSQL overall.

I don't know how useful the IP in the patents is, but I'd hate to see it
dismissed out-of-hand because of licensing difficulties that could be
overcome.
-- 
Jim C. Nasby, Database Consultant   [EMAIL PROTECTED] 
Give your computer some brain candy! www.distributed.net Team #1828

Windows: Where do you want to go today?
Linux: Where do you want to go tomorrow?
FreeBSD: Are you guys coming, or what?

---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings


[HACKERS] PostgreSQL Specification

2005-01-14 Thread Benjamin Arai








I asked this question a while back and I got an answer but I
lost it. 



Where can I get a copy of the SQL specification that PostgreSQL
follows? Who ever answered, as I recall said it was not free if that is any
help.



Benjamin 








Re: [HACKERS] sparse (static analyzer) report

2005-01-14 Thread Mark Wong
Ah, so you beat me to it Neil. ;)  Out of curiosity, how much worse
was it before you started fixing things?

Mark

On Sat, Jan 15, 2005 at 01:30:37PM +1100, Neil Conway wrote:
 BTW, perhaps one reason for the relatively small number of legitimate 
 issues picked up by sparse is that I ran sparse on the tree a month or 
 two ago and fixed some of the stylistic issues it reported. Most of the 
 stuff I didn't bother to fix looked like either a sparse bug, or a 
 marginal style improvement I didn't bother applying (like fixing 0 = 
 NULL in dllist.c).
 
 I've been meaning to investigate whether sparse can be used as something 
 more than just a fussy syntax checker (i.e. whether it can do any 
 meaningful static analysis for interesting properties), but I haven't 
 had a chance yet.
 
 Alvaro Herrera wrote:
  It's complaining in several places about function as variables in
  function declarations (the multiple walkers and mutators for example);
  not sure how correct that is.
 
 I believe the conclusion of prior discussions about making the 
 walker/mutator prototypes more precise is that it's not worth the cost.
 
 -Neil
 
 P.S. Hope everyone had a good holiday. I'm back at work on Monday.



---(end of broadcast)---
TIP 8: explain analyze is your friend


Re: [HACKERS] PostgreSQL Specification

2005-01-14 Thread Rod Taylor
 Where can I get a copy of the SQL specification that PostgreSQL
 follows?  Who ever answered, as I recall said it was not free if that
 is any help.

http://developer.postgresql.org/readtext.php?src/FAQ/FAQ_DEV.html
+Developers-FAQ#1.16
-- 


---(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: [HACKERS] PostgreSQL Specification

2005-01-14 Thread Dann Corbit








You are referring (no doubt) to the ANSI/ISO
SQL Standard.

The papers are $18 each from ANSI in pdf
format (or they were when I bought them some time ago).

There are draft versions scattered about
on the internet for free.

This looks like a set of them:

http://www.cse.iitb.ac.in/dbms/Data/Papers-Other/SQL1999/













From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Benjamin Arai
Sent: Friday, January 14, 2005
2:51 PM
To: pgsql-hackers@postgresql.org
Subject: [HACKERS] PostgreSQL
Specification





I asked this question a while back and I got an answer but I
lost it. 



Where can I get a copy of the SQL specification that
PostgreSQL follows? Who ever answered, as I recall said it was not free
if that is any help.



Benjamin 








Re: [HACKERS] sparse (static analyzer) report

2005-01-14 Thread Alvaro Herrera
On Fri, Jan 14, 2005 at 05:50:30PM -0800, Mark Wong wrote:

 Yeah, I generate the file list to run sparse against with a
 find . -name '*.c'.  So that's simple enough.  But flex and bison
 files don't end in .c, do they?

Generated files do.  I have a list of generated files here:

pl_gram.c
pl_scan.c
psqlscan.c
preproc.c
pgc.c
guc-file.c
fmgrtab.c
gram.c
scan.c
bootparse.c
bootscanner.c

Not sure how to skip them with find ... I think you can do that with
-regex but it's cumbersome.  Re: port, I think you can -prune it.

-- 
Alvaro Herrera ([EMAIL PROTECTED])
Jude: I wish humans laid eggs
Ringlord: Why would you want humans to lay eggs?
Jude: So I can eat them

---(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


[HACKERS] On schedule for 8.0.0 packaging on Monday

2005-01-14 Thread Bruce Momjian
FYI, we are on schedule for 8.0.0 packaging this Monday, with a release
on Wednesday, January 19, 2005!

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  pgman@candle.pha.pa.us   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

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


Re: [HACKERS] Time span conversion function

2005-01-14 Thread Brendan Jurd
Kris Jurka wrote:
On Sat, 15 Jan 2005, Brendan Jurd wrote:
 

 SELECT time_span( 'minute', now(), interval '10:43:55' );
643
   

The timestamp argument to this version of the function seems completely 
irrelevent.

Kris Jurka
 

I don't think so.  As I pointed out in the OP, to make this function 
work properly you need to define a startpoint and an endpoint.  The 
version of the function which accepts (text, timestamp, interval) 
arguments is really just using another notation to achieve the same 
thing - startpoint and endpoint.

The timestamp argument is only irrelevant if you're willing to assume 
now() is going to be the startpoint, which is not a fair assumption 
IMO.  I would rather give the caller the freedom of defining the 
startpoint himself, in either notation.

Of course, it would be possible to create a shorthand version of the 
function which expects (text, interval), and passes directly to 
time_span($1, now(), $2).

Does that resolve your concern?  If not please explain it more fully.
BJ
---(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: [HACKERS] Time span conversion function

2005-01-14 Thread Tom Lane
Brendan Jurd [EMAIL PROTECTED] writes:
 Of course, it would be possible to create a shorthand version of the 
 function which expects (text, interval), and passes directly to 
 time_span($1, now(), $2).

This bothers me a bit.  That essentially says that (text, interval)
has a hidden instability: the results depend on when you execute it.

If we allow this form, it should be restricted to only those units
(values of the text parameter) for which the result would *not*
depend on now().

regards, tom lane

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

   http://archives.postgresql.org


Re: [HACKERS] Time span conversion function

2005-01-14 Thread Brendan Jurd
Tom Lane wrote:
Brendan Jurd [EMAIL PROTECTED] writes:
 

Of course, it would be possible to create a shorthand version of the 
function which expects (text, interval), and passes directly to 
time_span($1, now(), $2).
   

This bothers me a bit.  That essentially says that (text, interval)
has a hidden instability: the results depend on when you execute it.
If we allow this form, it should be restricted to only those units
(values of the text parameter) for which the result would *not*
depend on now().
 

mm, I see your point.  I suppose the only real reason to have the 
shorthand version is for people who want to test an interval value and 
don't particularly care what the startpoint is -- so they just use now() 
because it's a convenient way of getting a timestamp that satisfies the 
function.

To be honest, I'd be quite comfortable with dropping the shorthand 
version from the proposal.  If the caller has to type another 7 
characters, so be it.  It could fall under the if you want it, define 
your own function for it category.

BJ
---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings


Re: [HACKERS] sparse (static analyzer) report

2005-01-14 Thread Greg Stark

Alvaro Herrera [EMAIL PROTECTED] writes:

 Hmm.  Well, it showed the multiple incorrect uses of 0 as NULL in
 dllist.c and other places, 

Incidentally, while it may not be conformant to your style guidelines, use of
the constant 0 compared to or assigned to a pointer is a perfectly valid ANSI
spelling for NULL. (The same is not true for an expression that happens to
evaluate to 0.)

-- 
greg


---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
  joining column's datatypes do not match