Re: [HACKERS] invalidating cached plans

2005-03-13 Thread Tom Lane
Neil Conway <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> I would like to see this folded together with creation of a centralized >> plan caching module. > Interesting. Can you elaborate on how you'd envision call sites making > use of this module? I hadn't really gotten as far as working out

Re: [HACKERS] int64/double for time/timestamp

2005-03-13 Thread Thomas Hallgren
Teodor Sigaev wrote: Urgh. This is clearly a bug. All the code in utils/adt seems to be correctly set up to treat TimeADT as an integral value, but then the two macros quoted are converting the value to float8 and back again ... so what's actually on disk is the float8 equivalent of what the int6

Re: [HACKERS] invalidating cached plans

2005-03-13 Thread Neil Conway
Tom Lane wrote: I would like to see this folded together with creation of a centralized plan caching module. Interesting. Can you elaborate on how you'd envision call sites making use of this module? The difficulty with this after-the-fact approach is that the finished plan tree may contain no re

Re: [HACKERS] invalidating cached plans

2005-03-13 Thread Tom Lane
Neil Conway <[EMAIL PROTECTED]> writes: > PostgreSQL should invalidate a cached query plan when one of the objects > the plan depends upon is modified. Agreed. > Implementation sketch: I would like to see this folded together with creation of a centralized plan caching module. We currently have

[HACKERS] options in conninfo

2005-03-13 Thread Christopher Kings-Lynne
Hi, Using libpq PQconnect function, what is the syntax for the 'options' entry in the conninfo? I think the docs should be updated to give an example.. http://www.postgresql.org/docs/8.0/interactive/libpq.html#LIBPQ-CONNECT Thanks, Chris ---(end of broadcast)

Re: [HACKERS] [BUGS] We are not following the spec for HAVING without GROUP

2005-03-13 Thread Bruno Wolff III
On Mon, Mar 14, 2005 at 01:52:59 -0500, Tom Lane <[EMAIL PROTECTED]> wrote: > Bruno Wolff III <[EMAIL PROTECTED]> writes: > > If someone did a naive implementation of first() and last() aggregates > > for 8.1, is that something that would likely be accepted? > > For the purpose that Greg is sugg

Re: [HACKERS] signed short fd

2005-03-13 Thread Tom Lane
"Qingqing Zhou" <[EMAIL PROTECTED]> writes: > So is there any special reason we don't worry that convert an integer to > short will not lose data? It's not possible for that to happen unless the user has set max_files_per_process to more than 32K, so I'm not particularly worried. Do you know of a

Re: [HACKERS] [BUGS] We are not following the spec for HAVING without GROUP

2005-03-13 Thread Tom Lane
Bruno Wolff III <[EMAIL PROTECTED]> writes: > If someone did a naive implementation of first() and last() aggregates > for 8.1, is that something that would likely be accepted? For the purpose that Greg is suggesting, these would have no advantage over min() or max() --- since the system wouldn't

Re: [HACKERS] [BUGS] We are not following the spec for HAVING without GROUP

2005-03-13 Thread Tom Lane
Greg Stark <[EMAIL PROTECTED]> writes: > On Wed, 2005-03-09 at 21:21 -0500, Tom Lane wrote: >> Comments? Can anyone confirm whether DB2 or other databases allow >> ungrouped column references with HAVING? > Mysql treats ungrouped columns as an assertion that those columns will all be > equal for

[HACKERS] invalidating cached plans

2005-03-13 Thread Neil Conway
PostgreSQL should invalidate a cached query plan when one of the objects the plan depends upon is modified. This is the common case of a more general problem: a query plan depends on various parts of the environment at plan-creation time. That environment includes the definitions of database object

Re: [HACKERS] [BUGS] We are not following the spec for HAVING without GROUP

2005-03-13 Thread Bruno Wolff III
On Mon, Mar 14, 2005 at 00:35:32 -0500, Greg Stark <[EMAIL PROTECTED]> wrote: > > Bruno Wolff III <[EMAIL PROTECTED]> writes: > > > If someone did a naive implementation of first() and last() aggregates > > for 8.1, is that something that would likely be accepted? > > You mean like this? > >

Re: [HACKERS] Null Value Stored for Date e TimeStamp

2005-03-13 Thread Tom Lane
Fernando Ferreira <[EMAIL PROTECTED]> writes: > I would like know about the value stored for null value for fields date > and timestamp. There isn't any; we don't store anything at all for a null. I don't think those other DBs you mention equate a null to some particular randomly chosen date, ei

Re: [HACKERS] [BUGS] We are not following the spec for HAVING without GROUP

2005-03-13 Thread Greg Stark
Bruno Wolff III <[EMAIL PROTECTED]> writes: > If someone did a naive implementation of first() and last() aggregates > for 8.1, is that something that would likely be accepted? You mean like this? CREATE FUNCTION first_accum(anyelement,anyelement) RETURNS anyelement as 'select coalesce($1,$2)

[HACKERS] signed short fd

2005-03-13 Thread Qingqing Zhou
We have the following definition in fd.c: typedef struct vfd { signed short fd; /* current FD, or VFD_CLOSED if none */ ... } Vfd; but seems we use Vfd.fd as an integer, say in fileNameOpenFile() we have: vfdP->fd = BasicOpenFile(fileName, fileFlags, fileMode); So is there any special reas

Re: [HACKERS] date_trunc problem in HEAD

2005-03-13 Thread Robert Creager
OK. I believe the following function provides the correct functionality. Agree/disagree? If it's good, I'll figure out how to convert this little monster to C... CREATE OR REPLACE FUNCTION date_trunc_week(timestamp without time zone) RETURNS timestamp without time zone AS ' DECLARE rea

Re: [HACKERS] [PERFORM] How to read query plan

2005-03-13 Thread Tom Lane
I wrote: > Since ExecProject operations within a nest of joins are going to be > dealing entirely with Vars, I wonder if we couldn't speed matters up > by having a short-circuit case for a projection that is only Vars. > Essentially it would be a lot like execJunk.c, except able to cope > with two

Re: [HACKERS] [BUGS] We are not following the spec for HAVING without GROUP

2005-03-13 Thread Bruno Wolff III
On Sun, Mar 13, 2005 at 23:24:18 -0500, Greg Stark <[EMAIL PROTECTED]> wrote: > > I've noticed quite frequently scenarios where this idiom would be very handy. > I usually either end up rewriting the query to have nested subqueries so I can > push the grouping into the subquery. This doesn't alw

Re: [HACKERS] [BUGS] We are not following the spec for HAVING without GROUP

2005-03-13 Thread Greg Stark
> On Wed, 2005-03-09 at 21:21 -0500, Tom Lane wrote: > > Comments? Can anyone confirm whether DB2 or other databases allow > > ungrouped column references with HAVING? Mysql treats ungrouped columns as an assertion that those columns will all be equal for the group and it can pick an arbitrary

Re: [HACKERS] TODO item: support triggers on columns

2005-03-13 Thread Bruce Momjian
Greg Sabino Mullane wrote: [ There is text before PGP section. ] > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > > > I'd like to start working on the following TODO item: > > Referential Integrity / Support triggers on columns > > > > Is somebody else already working on this? > > Sorry

Re: [HACKERS] We are not following the spec for HAVING without GROUP

2005-03-13 Thread Terry Yapt
Results from Oracle 9.2.0.3 (9.2 patch 2) === Connected to Oracle9i Release 9.2.0.3.0 Connected as system SQL> SQL> DROP TABLE TESTTAB; DROP TABLE TESTTAB ORA-00942: table or view does not exist SQL> create table TESTtab (col integer); Table created SQL> select 1 as col from TESTt

Re: [HACKERS] [BUGS] We are not following the spec for HAVING without GROUP

2005-03-13 Thread John R Pierce
select 1 from tab having 1=1; returns 2 rows I'm curious whats in those two rows... {{1} {1}} ? ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [HACKERS] Bumping libpq version number?

2005-03-13 Thread Kurt Roeckx
On Fri, Mar 11, 2005 at 12:58:28PM -0500, Bruce Momjian wrote: > Are we still bumping the libpq major version number for 8.0.2? I think > it is a bad idea because we will require too many client apps to be > recompiled, and we have had few problem reports. > > We do need to bump the major version

Re: [HACKERS] One vacuum full is not enough.

2005-03-13 Thread Christopher Browne
[EMAIL PROTECTED] (Gaetano Mendola) wrote: > Hi all, > running a 7.4.5 it happen to me with another table > where a single vacuum full was not freeing enough pages, > here the verbose vacuum full, as you can see only at > the end: truncated 8504 to 621 pages. > > I use pg_autovacuum and it's not e

[HACKERS] Null Value Stored for Date e TimeStamp

2005-03-13 Thread Fernando Ferreira
Hi, I would like know about the value stored for null value for fields date and timestamp. Sample SQL Server 1753/01/01 Oracle 0001/01/01 Informix 1899/01/01 Visual Foxpro DBF 1899/12/30 I used a tool for migrate database and informed the n

Re: [HACKERS] A bad plan

2005-03-13 Thread Gaetano Mendola
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Josh Berkus wrote: > Gaetano, > > >>Hi all, >>running a 7.4.5 engine, I'm facing this bad plan: > > > Please take this to the PGSQL-PERFORMANCE mailing list; that's what that list > exists for. > > Or IRC, where I know your are sometimes. But no

Re: [HACKERS] [BUGS] We are not following the spec for HAVING without GROUP

2005-03-13 Thread Mark Shewmaker
On Wed, 2005-03-09 at 21:21 -0500, Tom Lane wrote: > Comments? Can anyone confirm whether DB2 or other databases allow > ungrouped column references with HAVING? In Sybase: 1> select 2 as id, max(myfield) from mytable where 2=1 2> go id --- -- 2

Re: [HACKERS] We are not following the spec for HAVING without GROUP BY

2005-03-13 Thread Michael Wimmer
Just a quick test on the DBMS I have available at work. IBM Informix Dynamic Server Version 10.00.TC1TL Error: The column (id) must be in the GROUP BY list. Oracle 9.2.0.11 Returns the same records as if where would be used. MSSQL Express 2005 Beta February TP Error: Column 'tab.id' is invalid in t

Re: [HACKERS] One vacuum full is not enough.

2005-03-13 Thread Gaetano Mendola
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hannu Krosing wrote: > Ühel kenal päeval (teisipäev, 8. märts 2005, 00:52+0100), kirjutas > Gaetano Mendola: > >>Hi all, >>running a 7.4.5 it happen to me with another table >>where a single vacuum full was not freeing enough pages, >>here the verbose

Re: [BUGS] [HACKERS] We are not following the spec for HAVING without GROUP BY

2005-03-13 Thread Gill, Jerry T.
Here is your Sql run in a DB2 database. connect to phoenix Database Connection Information Database server= DB2/LINUX 8.1.5 SQL authorization ID = GILL Local database alias = PHOENIX create table tab (col integer) DB2I The SQL command completed successfully. select 1 fro

Re: [HACKERS] [ADMIN] Too frequent warnings for wraparound failure

2005-03-13 Thread Milen A. Radev
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tom Lane wrote: > I wrote: > >>"Milen A. Radev" <[EMAIL PROTECTED]> writes: >> >>>I review the log every morning. In the beginning I got "wraparound >>>failure" warnings every third day. But from a week I got those warnings >>>every day. Well we have

[HACKERS] Grant ALL on schema

2005-03-13 Thread Hemapriya
Hi, Can anybody know how the following statement work. Grant ALL on SCHEMA test to user 'user1'; will the user be able to have all the privileges on all the objects/tables on schema test? Or he can only create new objects in that schema. Thanks Priya

Re: [BUGS] [HACKERS] We are not following the spec for HAVING without GROUP BY

2005-03-13 Thread Mark Shewmaker
On Thu, Mar 10, 2005 at 12:44:50PM -0500, Tom Lane wrote: > > Would those of you with access to other DBMSes try this: > > create table tab (col integer); > select 1 from tab having 1=0; > select 1 from tab having 1=1; > insert into tab values(1); > insert into tab values(2); > select 1 from tab

Re: [HACKERS] Bumping libpq version number?

2005-03-13 Thread Kurt Roeckx
On Fri, Mar 11, 2005 at 01:29:46PM -0500, Bruce Momjian wrote: > Kurt Roeckx wrote: > > > > Does initdb call pg_snprintf directly? Or does it call some > > libpq function that calls it? > > With the current CVS, initdb calls pg_snprintf() on my platform which > doesn't support %$ natively on my

Re: [BUGS] [HACKERS] We are not following the spec for HAVING without

2005-03-13 Thread Gary Doades
Tom Lane wrote: Would those of you with access to other DBMSes try this: create table tab (col integer); select 1 from tab having 1=0; select 1 from tab having 1=1; insert into tab values(1); insert into tab values(2); select 1 from tab having 1=0; select 1 from tab having 1=1; I claim that a SQL-c

Re: [HACKERS] Bumping libpq version number?

2005-03-13 Thread Kurt Roeckx
On Fri, Mar 11, 2005 at 04:49:23PM -0500, Bruce Momjian wrote: > > In fact, based on the few complaints we have heard about the current > situation, I am sure we are going to get many more complaints if we bump > up the major version in 8.0.2. I think it's better to have people complain that they

[HACKERS] where is the locale set for each server instance?

2005-03-13 Thread Palle Girgensohn
Hi! I'm pluggin ICU into PostgreSQL for unicode collation, since FreeBSD has no support for unicode collation. It works fine, but I cannot find out where to set the default locale for each backend instance. I want to use the LC_COLLATE used in initdb, now I've just hard wired it for my own needs

Re: [HACKERS] [PERFORM] How to read query plan

2005-03-13 Thread Tom Lane
=?windows-1250?Q?Miroslav_=8Aulc?= <[EMAIL PROTECTED]> writes: >> Is the data confidential? If you'd be willing to send me a pg_dump >> off-list, I'd like to replicate this test and try to see where the time >> is going. >> > Thank you very much for your offer. The data are partially confidental

Re: [HACKERS] date_trunc problem in HEAD

2005-03-13 Thread Kurt Roeckx
On Sun, Mar 13, 2005 at 12:48:00PM -0700, Robert Creager wrote: > When grilled further on (Sun, 13 Mar 2005 19:40:02 +0100), > Kurt Roeckx <[EMAIL PROTECTED]> confessed: > > > > Attached is a patch against HEAD for your review. > > > > It has this comment in it: > >

[HACKERS] materialized views

2005-03-13 Thread Oleg Bartunov
Hi there, I read Jonathan Gardner's http://jonathangardner.net/PostgreSQL/materialized_views/matviews.html and wondering if there some works on mat.views ? I found academic project http://research.csc.ncsu.edu/selftune/ which has implementation of matviews in postgresql 7.3.4. Code is available u

Re: [HACKERS] Bumping libpq version number?

2005-03-13 Thread Andrew - Supernews
On 2005-03-13, Bruce Momjian wrote: > Andrew - Supernews wrote: >> On 2005-03-11, Bruce Momjian wrote: >> > I can think of no way to prevent it, except on Win32 that has an exports >> > file. >> >> At least a significant minority, if not an actual majority, of Unix >> platforms do allow this; in

Re: [HACKERS] Cost of XLogInsert CRC calculations

2005-03-13 Thread Simon Riggs
On Fri, 2005-03-11 at 19:31 +0100, Hans-JÃrgen SchÃnig wrote: > > One of the things I was thinking about was whether we could use up those > > cycles more effectively. If we were to include a compression routine > > before we calculated the CRC that would > > - reduce the size of the blocks to be

Re: [HACKERS] date_trunc problem in HEAD

2005-03-13 Thread Robert Creager
When grilled further on (Sun, 13 Mar 2005 19:40:02 +0100), Kurt Roeckx <[EMAIL PROTECTED]> confessed: > > Attached is a patch against HEAD for your review. > > It has this comment in it: >/* the new year cannot be greater than the >

Re: [HACKERS] Bumping libpq version number?

2005-03-13 Thread Bruce Momjian
Andrew - Supernews wrote: > On 2005-03-11, Bruce Momjian wrote: > > Kurt Roeckx wrote: > >> I assume libpq is staticly linked to pgport and is exporting > >> symbols it shouldn't. Can we prevent it from exporting those > >> symbols? > > > > I can think of no way to prevent it, except on Win32 tha

Re: [HACKERS] TODO item: support triggers on columns

2005-03-13 Thread Tom Lane
"Greg Sabino Mullane" <[EMAIL PROTECTED]> writes: > By the way, does anyone know what the tgattr field in pg_triggers > is for? http://developer.postgresql.org/docs/postgres/catalog-pg-trigger.html says "currently unused" and a desultory search through the sources confirms that. I imagine it was

Re: [HACKERS] date_trunc problem in HEAD

2005-03-13 Thread Kurt Roeckx
On Sun, Mar 13, 2005 at 11:12:32AM -0700, Robert Creager wrote: > > Hey All, > > I goofed with the patch I submitted last year for adding 'week' capability to > the date_trunc function. > > Attached is a patch against HEAD for your review. It has this comment in it:

[HACKERS] date_trunc problem in HEAD

2005-03-13 Thread Robert Creager
Hey All, I goofed with the patch I submitted last year for adding 'week' capability to the date_trunc function. Attached is a patch against HEAD for your review. Cheers, Rob -- 11:00:49 up 47 days, 16:17, 4 users, load average: 3.01, 2.37, 2.37 Linux 2.6.5-02 #8 SMP Mon Jul 12 21:34:44 MDT

Re: [HACKERS] TODO item: support triggers on columns

2005-03-13 Thread Chris Mair
> > I'd like to start working on the following TODO item: > > Referential Integrity / Support triggers on columns > > > > Is somebody else already working on this? > > Sorry for not jumping in earlier. As Rob said, I am working on > column-level support for triggers. I did not have my name addded

Re: [HACKERS] Strange postgres planner behaviour

2005-03-13 Thread Oleg Bartunov
On Sat, 12 Mar 2005, Tom Lane wrote: "Sergey E. Koposov" <[EMAIL PROTECTED]> writes: I want to descibe some strange behaviour of the postgres planner. It's not strange exactly: the mechanism for OR indexscan and the mechanism for nestloop join indexscan are separate and don't talk to each other. S

Re: [HACKERS] TODO item: support triggers on columns

2005-03-13 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 > I'd like to start working on the following TODO item: > Referential Integrity / Support triggers on columns > > Is somebody else already working on this? Sorry for not jumping in earlier. As Rob said, I am working on column-level support for trigg

Re: [HACKERS] REL8_0_STABLE and 8.0.1 release client logging difference

2005-03-13 Thread Oleg Bartunov
On Sun, 13 Mar 2005, Andrew Dunstan wrote: Oleg Bartunov said: On Sat, 12 Mar 2005, Tom Lane wrote: Oleg Bartunov writes: REL8_0_STABLE: tycho=# select * from pg_stas where srelnae='tycho'; tycho=# \q Works fine for me in REL8_0_STABLE tip ... and it's working fine on all the build farm machines t

Re: [HACKERS] Bumping libpq version number?

2005-03-13 Thread Andrew - Supernews
On 2005-03-11, Bruce Momjian wrote: > Kurt Roeckx wrote: >> I assume libpq is staticly linked to pgport and is exporting >> symbols it shouldn't. Can we prevent it from exporting those >> symbols? > > I can think of no way to prevent it, except on Win32 that has an exports > file. At least a sig

Re: [HACKERS] Question about encoding combinations

2005-03-13 Thread Peter Eisentraut
Bruce Momjian wrote: > Why is BIG5 listed as not allowing UTF8 on the client, but you can > have UTF8 on the server and BIG5 on the client? Because BIG5 is a client-only encoding. > Why can't you have UTF8 on the server and client? Sure you can. > Why can't you have MULE_INTERNAL on the server

Re: [HACKERS] REL8_0_STABLE and 8.0.1 release client logging difference

2005-03-13 Thread Andrew Dunstan
Oleg Bartunov said: > On Sat, 12 Mar 2005, Tom Lane wrote: > >> Oleg Bartunov writes: >>> REL8_0_STABLE: >>> tycho=# select * from pg_stas where srelnae='tycho'; >>> tycho=# \q >> >> Works fine for me in REL8_0_STABLE tip ... and it's working fine on >> all the build farm machines too, because thi

Re: [HACKERS] REL8_0_STABLE and 8.0.1 release client logging difference

2005-03-13 Thread Oleg Bartunov
On Sat, 12 Mar 2005, Tom Lane wrote: Oleg Bartunov writes: REL8_0_STABLE: tycho=# select * from pg_stas where srelnae='tycho'; tycho=# \q Works fine for me in REL8_0_STABLE tip ... and it's working fine on all the build farm machines too, because this would surely cause all the regression tests to