Re: [SQL] why vacuum

2005-10-25 Thread Bath, David
On Wed, 26 Oct 2005 15:14, Tom Lane wrote: > Kenneth Gonsalves <[EMAIL PROTECTED]> writes: > > (A MySQul guy said, not Kenneth)... > > 'I wouldnt commit mission critical data to a database that needs to be > > vacuumed once a week'. My two-penneth worth... I wouldn't commit mission cri

Re: [SQL] why vacuum

2005-10-25 Thread Michael Fuhr
On Wed, Oct 26, 2005 at 10:15:17AM +0530, Kenneth Gonsalves wrote: > i was in a minor flame war with a mysql guy - his major grouse was that > 'I wouldnt commit mission critical data to a database that needs to be > vacuumed once a week'. The use of the word "commit" is amusing, considering that

Re: [SQL] why vacuum

2005-10-25 Thread Tom Lane
Kenneth Gonsalves <[EMAIL PROTECTED]> writes: > i was in a minor flame war with a mysql guy - his major grouse was that > 'I wouldnt commit mission critical data to a database that needs to be > vacuumed once a week'. This guy is not worth arguing with. > So why does pg need vacuum? Every data

[SQL] why vacuum

2005-10-25 Thread Kenneth Gonsalves
hi, i was in a minor flame war with a mysql guy - his major grouse was that 'I wouldnt commit mission critical data to a database that needs to be vacuumed once a week'. So why does pg need vacuum? -- regards kg http://www.livejournal.com/users/lawgon tally ho! http://avsap.org.in ಇಂಡ್ಲಿನಕ್ಸ வா

Re: [SQL] padding an integer ...

2005-10-25 Thread Michael Fuhr
On Wed, Oct 26, 2005 at 12:57:25AM -0300, Marc G. Fournier wrote: > Is there any way of "padding" an integer, similar to how, in perl, I would > do: > > printf("%03d", 1); > > to get: > > 001 test=> SELECT to_char(1, '000'); to_char - 001 (1 row) http://www.postgresql.org/docs/8.0

[SQL] pl/* overhead ...

2005-10-25 Thread Marc G. Fournier
Does anyone know of, or have, any comparisions of the overhead going with something like pl/perl or pl/php vs using pl/pgsql? Thanks ... Marc G. Fournier Hub.Org Networking Services (http://www.hub.org) Email: [EMAIL PROTECTED] Yahoo!: yscrappy ICQ: 76156

[SQL] padding an integer ...

2005-10-25 Thread Marc G. Fournier
Is there any way of "padding" an integer, similar to how, in perl, I would do: printf("%03d", 1); to get: 001 Specifically, I'm looking to do this in a pl/pgsql function ... like to avoid moving to pl/php or pl/perl if I can ... but, from what I've been able to find, I suspect I'm not goi

Re: [SQL] broken join optimization? (8.0)

2005-10-25 Thread Tom Lane
Michael Fuhr <[EMAIL PROTECTED]> writes: > On Tue, Oct 25, 2005 at 04:56:11PM -0700, chester c young wrote: >> in php (for example) it's frequently nice to get the structure of a >> table without any data, > Have you considered "SELECT * FROM mytable LIMIT 0"? Indeed. > I see the same behavior i

Re: [SQL] backend error

2005-10-25 Thread Michael Fuhr
On Tue, Oct 25, 2005 at 06:28:38PM -0500, Judith Altamirano Figueroa wrote: > Hello everybody I have a failure making a select in a table the error > that returns is the follow: > > Backend message type 0x44 arrived while idle > pqReadData() -- backend closed the channel unexpectedly. > Th

Re: [SQL] broken join optimization? (8.0)

2005-10-25 Thread Michael Fuhr
On Tue, Oct 25, 2005 at 04:56:11PM -0700, chester c young wrote: > in php (for example) it's frequently nice to get the structure of a > table without any data, ie, pull a single row with each attribute's > value is null. I use the query (dual is a table of one row ala > Oracle): > > select m.* f

Re: [SQL] ?Equiv to oracle (ENABLE|DISABLE) (CONSTRAINT|TRIGGER) statements?

2005-10-25 Thread Bruce Momjian
Please see the 8.1 beta release notes for new capabilities in that release. --- Bath, David wrote: > Folks, > > Summary: > Does postgresql have equivalents to the following Oracle statements? > DISABLE CONSTRAINT ...

[SQL] ?Equiv to oracle (ENABLE|DISABLE) (CONSTRAINT|TRIGGER) statements?

2005-10-25 Thread Bath, David
Folks, Summary: Does postgresql have equivalents to the following Oracle statements? DISABLE CONSTRAINT ... ENABLE CONSTRAINT ... DISABLE TRIGGER ... ENABLE TRIGGER ... Background: One of the advantages of Oracle over some competitors such as MS-SQL and Sybase is the ability

[SQL] broken join optimization? (8.0)

2005-10-25 Thread chester c young
in php (for example) it's frequently nice to get the structure of a table without any data, ie, pull a single row with each attribute's value is null. I use the query (dual is a table of one row ala Oracle): select m.* from dual left join mytable m on( false ); this works every time, but if myta

[SQL] backend error

2005-10-25 Thread Judith Altamirano Figueroa
Hello everybody I have a failure making a select in a table the error that returns is the follow: Backend message type 0x44 arrived while idle pqReadData() -- backend closed the channel unexpectedly.     This probably means the backend terminated abnormally     before or while processi

Re: [SQL] Delete rule chain stops unexpectedly

2005-10-25 Thread Tom Lane
Wiebe Cazemier <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> Because the rule converts those inserts into, effectively, >> >> INSERT INTO debuglog SELECT ... WHERE EXISTS(some matching OLD row); >> >> and there are no longer any matching OLD rows in the view. > Is this behaviour also present

Re: [SQL] 8.0.x windows installer fails?

2005-10-25 Thread Magnus Hagander
> [Win XP Professional 2002, SP 1, Pentium 4, 1.4 GHz, 512MB > RAM] I'm trying to install postgres 8.0.4 on my windows machine. > I downloaded > ftp.us.postgresql.org/pub/mirrors/postgresql/binary/v8.0.4/win > 32/postgresql-8.0.4.zip. > I then double-clicked the file "postgresql-8.0". > It says "

[SQL] 8.0.x windows installer fails?

2005-10-25 Thread george young
[Win XP Professional 2002, SP 1, Pentium 4, 1.4 GHz, 512MB RAM] I'm trying to install postgres 8.0.4 on my windows machine. I downloaded ftp.us.postgresql.org/pub/mirrors/postgresql/binary/v8.0.4/win32/postgresql-8.0.4.zip. I then double-clicked the file "postgresql-8.0". It says "Welcome to the P

Re: [SQL] Delete rule chain stops unexpectedly

2005-10-25 Thread Wiebe Cazemier
Tom Lane wrote: So, the actual delete should be done after all the rules. And even if it does delete before anything else, that does not explain why "step2" is not inserted into the debuglog table. Because the rule converts those inserts into, effectively, INSERT INTO debuglog SELECT

Re: [SQL] automatic update or insert

2005-10-25 Thread codeWarrior
The following trigger procedure works for me you'd need to adjust this to manipulate YOUR table schema: DROP FUNCTION dmc_comp_plan_duplicates() CASCADE; CREATE OR REPLACE FUNCTION dmc_comp_plan_duplicates() RETURNS "trigger" AS $BODY$ DECLARE did integer; BEGIN SELECT COALESCE(id,

Re: [SQL] convert timezone to string ...

2005-10-25 Thread Marc G. Fournier
On Tue, 25 Oct 2005, Tom Lane wrote: "Marc G. Fournier" <[EMAIL PROTECTED]> writes: I know that the server knows that ADT == -0400, and AST == -0300 ... Other way around isn't it? Unless Canada observes a pretty strange variety of daylight saving time ;-) I knew I was going to get that bac

Re: [SQL] writable joined view

2005-10-25 Thread Richard Huxton
Sarah Asmaels wrote: Hi! I have one table referencing an object in another table through an ID, and a view joining those tables on the ID. I want to create rules to rewrite updates/deletes/inserts on the joined view to act on the real tables. Can you give me some pointers? The documentation has

Re: [SQL] automatic update or insert

2005-10-25 Thread Daryl Richter
tobbe wrote: Hi. I have a little problem. In a system of mine i need to insert records into table [tbStat], and if the records exist i need to update them instead and increase a column [cQuantity] for every update. I.e. the first insert sets cQuantity to 1, and for every other run cQuantity is

Re: [SQL] Merging lines with NULLs (with example data)

2005-10-25 Thread Daryl Richter
Harald Fuchs wrote: In article <[EMAIL PROTECTED]>, MaXX <[EMAIL PROTECTED]> writes: How can I "merge" this gday,count_udp,count_tcp '2005-10-20','','2' '2005-10-20','3','' '2005-10-21','','1' '2005-10-21','5','' into that: gday,count_udp,count_tcp '2005-10-20','3','2' '2005-10-21','5','1

Re: [SQL] Merging lines with NULLs (with example data)

2005-10-25 Thread Harald Fuchs
In article <[EMAIL PROTECTED]>, MaXX <[EMAIL PROTECTED]> writes: > How can I "merge" this > gday,count_udp,count_tcp > '2005-10-20','','2' > '2005-10-20','3','' > '2005-10-21','','1' > '2005-10-21','5','' > into that: > gday,count_udp,count_tcp > '2005-10-20','3','2' > '2005-10-21','5','1' > in

Re: [SQL] convert timezone to string ...

2005-10-25 Thread Tom Lane
"Marc G. Fournier" <[EMAIL PROTECTED]> writes: > I know that the server knows that ADT == -0400, and AST == -0300 ... Other way around isn't it? Unless Canada observes a pretty strange variety of daylight saving time ;-) regards, tom lane ---(end

Re: [SQL] writable joined view

2005-10-25 Thread Wiebe Cazemier
Sarah Asmaels wrote: Hi! I have one table referencing an object in another table through an ID, and a view joining those tables on the ID. I want to create rules to rewrite updates/deletes/inserts on the joined view to act on the real tables. Can you give me some pointers? The documentation has

Re: [SQL] convert timezone to string ...

2005-10-25 Thread Magnus Hagander
> I know that the server knows that ADT == -0400, and AST == > -0300 ... is there any way of reversing that? Basically, I > want to say: > > SELECT timezone_str(-0400, 'not dst'); > > and have it return ADT ... I've got a method of doing it > right now, using a function, but just find it look

Re: [SQL] automatic update or insert

2005-10-25 Thread PFC
In a system of mine i need to insert records into table [tbStat], and if the records exist i need to update them instead and increase a column [cQuantity] for every update. I.e. the first insert sets cQuantity to 1, and for every other run cQuantity is increased. Currently i have implemented t