Re: [GENERAL] using pg's internal timezone database?

2012-01-06 Thread Louis-David Mitterrand
On Tue, Dec 20, 2011 at 05:29:15AM -0700, Scott Marlowe wrote: > On Tue, Dec 20, 2011 at 2:05 AM, Louis-David Mitterrand > wrote: > > Hi, > > > > To provide my forum users with a 'timezeone' preference in their profile > > how can I use postgresql's in

[GENERAL] using pg's internal timezone database?

2011-12-20 Thread Louis-David Mitterrand
Hi, To provide my forum users with a 'timezeone' preference in their profile how can I use postgresql's internal table of timezones ? I found a reference to it here: http://www.postgresql.org/docs/7.2/static/timezones.html but not in recent versions docs. Thanks, -- Sent via pgsql-general ma

[GENERAL] FK violation on (emtpy) parent table

2011-08-11 Thread Louis-David Mitterrand
Hi, I have an empty parent 'price' table with several partitioned child tables that contain the actual data. How can I reference the parent 'price' table in a FK? When I try I get a FK violation. Is that expected behavior? Is there another way to do it? Thanks, -- Sent via pgsql-general mailin

Re: [GENERAL] "EXECUTE ... into var" doesn't set FOUND: bug or feature?

2010-09-16 Thread Louis-David Mitterrand
On Thu, Sep 16, 2010 at 10:12:57AM -0400, Tom Lane wrote: > Louis-David Mitterrand writes: > > I noticed that in a pl/pgsql function FOUND is not set after an > > EXECUTE ... into var; > > Bug or feature? > > It's behaving as documented: > http://www.pos

[GENERAL] "EXECUTE ... into var" doesn't set FOUND: bug or feature?

2010-09-16 Thread Louis-David Mitterrand
Hi, I noticed that in a pl/pgsql function FOUND is not set after an EXECUTE ... into var; Bug or feature? -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] inconsistency in aliasing

2009-01-14 Thread Louis-David Mitterrand
On Wed, Jan 14, 2009 at 05:53:57AM -0800, Lennin Caro wrote: > --- On Wed, 1/14/09, Louis-David Mitterrand > wrote: > > > From: Louis-David Mitterrand > > Subject: Re: [GENERAL] inconsistency in aliasing > > To: pgsql-general@postgresql.org > > Date: Wedn

Re: [GENERAL] inconsistency in aliasing

2009-01-14 Thread Louis-David Mitterrand
On Wed, Jan 14, 2009 at 06:31:55PM +0700, dbalinglung wrote: > what for of the syntax command +1 on order by ? maybe just wrong to > given result about the error query on order by, it's BUG ? *PARSE ERROR* -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to

Re: [GENERAL] inconsistency in aliasing

2009-01-14 Thread Louis-David Mitterrand
On Wed, Jan 14, 2009 at 12:06:47PM +0100, A. Kretschmer wrote: > In response to Louis-David Mitterrand : > > Hi, > > > > This works: > > > > critik=# select current_timestamp::abstime::int4 as score order by > > score; > > > > This does

[GENERAL] inconsistency in aliasing

2009-01-14 Thread Louis-David Mitterrand
Hi, This works: critik=# select current_timestamp::abstime::int4 as score order by score; This doesn't: critik=# select current_timestamp::abstime::int4 as score order by score + 1; ERROR: column "score" does not exist LINE 1: ...urrent_timestamp::abstime::i

[GENERAL] DBI error when changing views

2008-11-13 Thread Louis-David Mitterrand
Hello, When changing a view in my mod_perl (mason) application I typically get this error if I don't restart apache: "DBD::Pg::st execute failed: ERROR: cached plan must not change result type" Is there a way to avoid having to restart apache? Thanks, -- http://www.critikart.net --

Re: [GENERAL] group by error message?

2008-09-25 Thread Louis-David Mitterrand
On Thu, Sep 25, 2008 at 11:01:08AM -0400, Tom Lane wrote: > Louis-David Mitterrand <[EMAIL PROTECTED]> writes: > > critik=# select distinct pt.type_fr,sum(e2.id_event) from person_type > > pt natural join person_to_event join event e using (id_event) LEFT JOIN > >

[GENERAL] group by error message?

2008-09-25 Thread Louis-David Mitterrand
Hi, Running this query: critik=# select distinct pt.type_fr,sum(e2.id_event) from person_type pt natural join person_to_event join event e using (id_event) LEFT JOIN event e2 ON e.id_event = e2.id_event AND e2.id_event=219 join event_type et ON e.id_event_type = et.id_event_type where

Re: [GENERAL] can't create index with 'dowcast' row

2008-01-26 Thread Louis-David Mitterrand
On Fri, Jan 25, 2008 at 12:17:16AM -0500, Tom Lane wrote: > Louis-David Mitterrand <[EMAIL PROTECTED]> writes: > > CREATE UNIQUE INDEX visit_idx ON visit_buffer USING btree (id_session, > > id_story, created_on::date); > > > psql:visit_pkey.sql:5: E

[GENERAL] can't create index with 'dowcast' row

2008-01-24 Thread Louis-David Mitterrand
Hi, To constraint unique'ness of my visitors to a 24h periode I tried created a index including the 'date' part of the created_on timestamp: CREATE UNIQUE INDEX visit_idx ON visit_buffer USING btree (id_session, id_story, created_on::date); psql:visit_pkey.sql:5: ERROR:

Re: [GENERAL] postgres UTC different from perl?

2007-12-23 Thread Louis-David Mitterrand
On Wed, Dec 19, 2007 at 08:14:17PM -0500, Tom Lane wrote: > Richard Huxton <[EMAIL PROTECTED]> writes: > > I'm not sure that (CURRENT_DATE AT TIME ZONE 'UTC') does what you think > > it does. Try setting your timezone to various offsets and exploring. > > In fact, I think it's adjusting in exactl

[GENERAL] postgres UTC different from perl?

2007-12-19 Thread Louis-David Mitterrand
Hi, when trying: psql template1 -c "select date_part('epoch',current_date at time zone 'UTC');" date_part 1198015200 the result is different from perl -MDateTime -le 'print DateTime->today(time_zone => "UTC")->epoch;' 1198022400 Is there an issue with postgresql? ---

Re: [GENERAL] query pegs beta4

2007-12-15 Thread Louis-David Mitterrand
On Sat, Dec 15, 2007 at 12:39:30PM -0500, Tom Lane wrote: > Louis-David Mitterrand <[EMAIL PROTECTED]> writes: > > This new query of mine pegs beta4, it doesn't return and CPU is at 100%: > > select l.id_location,l.name, > > a.city > &g

[GENERAL] query pegs beta4

2007-12-15 Thread Louis-David Mitterrand
This new query of mine pegs beta4, it doesn't return and CPU is at 100%: select l.id_location,l.name, a.city from location l, address a, show_date x, show s, show s2 where (l.id_address = a.id_address

[GENERAL] 8.3beta4 needs a dump/restore?

2007-12-04 Thread Louis-David Mitterrand
Hi, While upgrading from 8.3-beta3 to beta4, postgres complained that the database format was not supported. I had to restore from backup. Was that intended? I didn't see any beta4 announcement on -general or -hackers. ---(end of broadcast)--- TI

Re: [GENERAL] timestamp skew during 7.4 -> 8.2 upgrade

2007-08-11 Thread Louis-David Mitterrand
On Fri, Aug 10, 2007 at 04:59:52PM -0400, Tom Lane wrote: > Karsten Hilbert <[EMAIL PROTECTED]> writes: > > On Fri, Aug 10, 2007 at 10:11:29AM +0200, Louis-David Mitterrand wrote: > >> So if I understand correctly, a timestamp_tz is ... > > > ... stored as UTC

Re: [GENERAL] timestamp skew during 7.4 -> 8.2 upgrade

2007-08-10 Thread Louis-David Mitterrand
On Thu, Aug 09, 2007 at 10:49:38AM -0500, Scott Marlowe wrote: > On 8/9/07, Louis-David Mitterrand > <[EMAIL PROTECTED]> wrote: > > Hi, > > > > After our 7.4 to 8.2 upgrade using debian tools, we realized that some > > of our timestamps with tz had shifted: >

[GENERAL] timestamp skew during 7.4 -> 8.2 upgrade

2007-08-09 Thread Louis-David Mitterrand
Hi, After our 7.4 to 8.2 upgrade using debian tools, we realized that some of our timestamps with tz had shifted: For example '2007-04-01 00:00:00+02' became '2007-03-31 23:00:00+01' which is on a different month. Some of our applications were severely disturbed by that. Has anyone noticed th

Re: [GENERAL] CASE in ORDER BY clause

2007-07-07 Thread Louis-David Mitterrand
On Fri, Jul 06, 2007 at 08:02:54PM +0400, Viatcheslav Kalinin wrote: > > # select start_date from show_date > # order by > # case when start_date > CURRENT_DATE then start_date end desc, > # case when start_date <= CURRENT_DATE then start_date end asc; The strange thing is when I try: sel

Re: [GENERAL] CASE in ORDER BY clause

2007-07-07 Thread Louis-David Mitterrand
On Fri, Jul 06, 2007 at 08:02:54PM +0400, Viatcheslav Kalinin wrote: > Louis-David Mitterrand wrote: > > # select start_date from show_date > # order by > # case when start_date > CURRENT_DATE then start_date end desc, > # case when start_date <= CURRENT_DATE then start_da

[GENERAL] CASE in ORDER BY clause

2007-07-06 Thread Louis-David Mitterrand
Hi, I am trying the following: critik=# select start_date from show_date order by case when start_date > CURRENT_DATE then start_date desc else start_date asc end; ERROR: syntax error at or near "desc" LINE 1: ...se when start_date > CURRENT_DATE then start_date desc els

[GENERAL] table referencing several others

2007-05-28 Thread Louis-David Mitterrand
Hello, To support a forum application I have a "forum" table: Column|Type -+- created_by | integer created_on | timestamp without time zone modified_by | integer modified_on |

[GENERAL] typical schema for a forum?

2007-05-09 Thread Louis-David Mitterrand
Hi, I'm trying to implement a forum with mason and postgresql. What is the typical database schema of a forum (threaded or flat) application? Thanks, ---(end of broadcast)--- TIP 6: explain analyze is your friend

[GENERAL] DBI support for pg native arrays?

2007-01-26 Thread Louis-David Mitterrand
Hello, For a "select array(...) as col1, col2, col3 from table" I'd like the DBI driver to output col1 as a perl array instead of a scalar "{res1,res2,etc.}" representation of it. Is that somehow possible? I looked at the docs without finding anything. Thanks, ---(end

[GENERAL] upgrading pl/pgsql triggers from 7.4 to 8.2

2007-01-25 Thread Louis-David Mitterrand
Hello, We tried upgrading a 7.4 base to 8.2 and found many issues with the triggers. What are the main changes in the pl/pgsql syntax or contraints checking between these two version? Thanks, ---(end of broadcast)--- TIP 2: Don't 'kill -9' the po

Re: [GENERAL] deduce sequence name from table and column

2005-12-20 Thread Louis-David Mitterrand
On Tue, Dec 20, 2005 at 10:31:46AM -0500, Tom Lane wrote: > Louis-David Mitterrand <[EMAIL PROTECTED]> writes: > > Is there a way (from DBI) to deduce a sequence name from the table and > > column it is attached to? > > Since 8.0 you can use pg_get_se

[GENERAL] deduce sequence name from table and column

2005-12-20 Thread Louis-David Mitterrand
Hi, Is there a way (from DBI) to deduce a sequence name from the table and column it is attached to? For instance: Column| Type |Modifiers -+-+--

[GENERAL] last comma inside "CREATE TABLE ()" statements

2001-04-22 Thread Louis-David Mitterrand
Is it against the SQL standard to accept a trailing comma in a table declaration? CREATE TABLE "currency" ( currency_id varchar(3), rate float, < BOOM! parse error ); As in perl, it would make life easier to simply ignore/accept a trailing comma on table declarations.

[GENERAL] Re: Trusted plperl

2001-04-22 Thread Louis-David Mitterrand
On Fri, Apr 20, 2001 at 03:42:24PM -0400, [EMAIL PROTECTED] wrote: > > Hey folks, I sent out this question a while back without > ever getting an answer, so here I go again :) > > Has anyone managed to compile a trusted plperl interpreter > into postgres? The Opcode stuff which blocks the use of

[GENERAL] Re: Trigger sending an eMail

2001-03-04 Thread Louis-David Mitterrand
On Mon, Feb 26, 2001 at 06:09:58PM -0300, Tulio Oliveira wrote: > How is the best form of a trigger send an email ? > > I'll need make the trigger in C or the plpgsql has any mail function ? #if !defined(_PATH_SENDMAIL) # define _PATH_SENDMAIL "/usr/lib/sendmail" #endif /*SENDMAIL*/ #define MAIL

[GENERAL] Re: avoiding endless loop in an UPDATE trigger

2001-03-04 Thread Louis-David Mitterrand
On Mon, Feb 26, 2001 at 11:53:51AM -0800, Norman J. Clarke wrote: > Hello, > > I am attempting to write a trigger function or rule in pl/pgsql that runs > on UPDATE to a table named "nodes". From inside this trigger, I would like > to UPDATE the same "nodes" table. How can I do this without enter

[GENERAL] UNIQUE constraint fails

2001-02-23 Thread Louis-David Mitterrand
With 7.1b4: test=# create table auction_type(id serial,login text,birthday timestamp); test=# create table auction(unique(login)) inherits("auction_type"); ERROR: inherited attribute "login" cannot be a PRIMARY KEY because it is not marked NOT NULL But I didn't ask that "login" be a PRIMARY K

[GENERAL] iterating over all NEW.* values in a trigger?

2001-02-22 Thread Louis-David Mitterrand
Inside a plpgsql function trigger, is it possible to a loop over all fields of the NEW record (and inspect their value) without knowing in advance from which table NEW will come? I am trying the following: DROP FUNCTION arch_func(); CREATE FUNCTION arch_func() RETURNS opaque AS ' DECLARE rec

[GENERAL] Re: inconstistent inheritance in 7.1?

2001-02-22 Thread Louis-David Mitterrand
On Thu, Feb 22, 2001 at 02:45:46PM +0100, Louis-David Mitterrand wrote: > Why does a SELECT apply to all tables, including inherited ones and not > UPDATEs or DELETEs? Is there a way to UPDATE a whole table hierarchy in > one fell swoop? Oops, I take that back; indeed it UPDATEs an

[GENERAL] inconstistent inheritance in 7.1?

2001-02-22 Thread Louis-David Mitterrand
Why does a SELECT apply to all tables, including inherited ones and not UPDATEs or DELETEs? Is there a way to UPDATE a whole table hierarchy in one fell swoop? TIA -- HIPPOLYTE: Donnerai-je l'exemple à la témérité ? Et dans un fol amour ma jeunesse embarquée...

[GENERAL] strategies for keeping an audit trail of UPDATEs

2001-02-20 Thread Louis-David Mitterrand
Hello, In our app we must keep a trace of all changes (UPDATEs) done to an important_table, so that it's possible to get a snapshot of a given record at a given date. The implementation strategy we are thinking about: 1. create an important_table_archive which inherits from important_table, 2

[GENERAL] using tables as types in other tables

2001-02-14 Thread Louis-David Mitterrand
In the app we are developing the concept of an address will occur very often on many tables (vendor, clients, employees, etc.) so we are looking to avoid code duplication by centralizing the addresses in one table. However I once read on one of the pgsql- lists that one could use a table name as

[GENERAL] a web interface to visualize tables

2000-11-01 Thread Louis-David Mitterrand
in perl (even better: mod_perl), - uses the DBI interface, Does such a beast exist? I am in the process of writing one, so I thought I'd check first... Thanks in advance, -- Louis-David Mitterrand - [EMAIL PROTECTED] - http://www.apartia.org "Kill a man, and you are an assassin. Kil

[GENERAL] detecting NULL column in SPI function

2000-09-28 Thread Louis-David Mitterrand
the Datum, test it for NULL, then run DatumGetFloat64() on it? Isn't there a simpler way? Thanks in advance for your help, cheers, -- Louis-David Mitterrand - [EMAIL PROTECTED] - http://www.apartia.org Hand, n.: A singular instrument worn at the end of a human arm and

[GENERAL] running maintenance tasks on DB

2000-09-23 Thread Louis-David Mitterrand
programming such tasks? Write a backend function (in pl/sql or C) and call it from a cron job? From a mod_perl handler? Thanks in advance for any insight, cheers, -- Louis-David Mitterrand - [EMAIL PROTECTED] - http://www.apartia.org

[GENERAL] OID decreasing?

2000-08-17 Thread Louis-David Mitterrand
178562 | vindex| 57500 | 2000-08-17 12:26:25+02 178592 | papy | 6 | 2000-08-17 12:26:52+02 178593 | vindex| 62500 | 2000-08-17 12:26:52+02 -- Louis-David Mitterrand - [EMAIL PROTECTED] - http://www.apartia.org Linux: The Ultimate NT Service Pack

[GENERAL] dangers of setlocale() in backend (was: problem with float8 input format)

2000-08-12 Thread Louis-David Mitterrand
On Sat, Aug 12, 2000 at 12:15:26PM -0400, Tom Lane wrote: > Louis-David Mitterrand <[EMAIL PROTECTED]> writes: > > When "seller_locale" is, for instance, "de_DE", then I get theses > > errors: > > ERROR: Bad float8 input format '0.05'

[GENERAL] problem with float8 input format

2000-08-10 Thread Louis-David Mitterrand
called from psql but fails (but not always!) from a C trigger. Thanks in advance for any help, -- Louis-David Mitterrand - [EMAIL PROTECTED] - http://www.apartia.org "Kill a man, and you are an assassin. Kill millions of men, and you are a conqueror. Kill everyone, and you are a god." -- Jean Rostand

[GENERAL] BLOB DBI func() interface under postgres

2000-06-27 Thread Louis-David Mitterrand
pass to this function to open a LOB? The aim is to be able to read a LOB from a postgres DB without having to lo_export the object to a file first. Can that be done with the $dbh->func() interface? (using lo_open, lo_read, etc ..) TIA -- Louis-David Mitterrand - [EMAIL PROTECTED] - http://www.apar

Re: [GENERAL] child table doesn't inherit PRIMARY KEY?

2000-06-04 Thread Louis-David Mitterrand
On Sun, Jun 04, 2000 at 03:46:53AM +0200, Peter Eisentraut wrote: > Louis-David Mitterrand writes: > > > When creating a child (through CREATE TABLE ... INHERIT (parent)) it > > seems the child gets all of the parent's contraints _except_ its PRIMARY > > KEY. Is thi

[GENERAL] Re: child table doesn't inherit PRIMARY KEY?

2000-06-03 Thread Louis-David Mitterrand
On Sat, Jun 03, 2000 at 05:22:56PM +0200, Louis-David Mitterrand wrote: > When creating a child (through CREATE TABLE ... INHERIT (parent)) it > seems the child gets all of the parent's contraints _except_ its PRIMARY > KEY. Is this normal? Should I add a PRIMARY KEY(id) statement

[GENERAL] child table doesn't inherit PRIMARY KEY?

2000-06-03 Thread Louis-David Mitterrand
When creating a child (through CREATE TABLE ... INHERIT (parent)) it seems the child gets all of the parent's contraints _except_ its PRIMARY KEY. Is this normal? Should I add a PRIMARY KEY(id) statement each time I create an inherited table? Cheers, -- Louis-David Mitterrand - [

[GENERAL] Re: [HACKERS] Oft Ask: How to contribute to PostgreSQL?

2000-05-31 Thread Louis-David Mitterrand
domain lives. Domains are diconnected from geography nowadays, and increasingly as we go. -- Louis-David Mitterrand - [EMAIL PROTECTED] - http://www.apartia.fr I don't build computers, I'm a cooling engineer. -- Seymour Cray, founder of Cray Inc.

[GENERAL] pg_dump -c doesn't order DROP TABLE correctly w.r.t inheritance

2000-05-31 Thread Louis-David Mitterrand
r the tables because you can't DROP a table when a child table isn't droped beforehand. -- Louis-David Mitterrand - [EMAIL PROTECTED] - http://www.apartia.fr I would like to meet the guy who invented sex, just to see what he's working on now.

[GENERAL] missing fmgr.h

2000-05-23 Thread Louis-David Mitterrand
When trying to build a trigger function in C I get a missing include: fmgr.h Should I simply comment out that include? [using the latest CVS image] -- Louis-David Mitterrand - [EMAIL PROTECTED] - http://www.apartia.fr Hoare's Law of Large Problems: Inside every large problem

[GENERAL] plperl extensions

2000-05-23 Thread Louis-David Mitterrand
your help, PS: I noticed the mbox downloads are broken in the mailing-list archives on postgresql.org and there is no search interface. I'd be willing to host one but first I need to be able to download the mboxes ;-) -- Louis-David Mitterrand - [EMAIL PROTECTED] - http://www.apartia.fr

[GENERAL] crash on \copy

2000-05-21 Thread Louis-David Mitterrand
Is this a known problem? template1=> \copy psql: xstrdup: cannot duplicate null pointer (internal error) styx:~% using PG 7.0-beta5 on Linux -- Louis-David Mitterrand - [EMAIL PROTECTED] - http://www.apartia.fr

[GENERAL] fmgr_info error

2000-05-21 Thread Louis-David Mitterrand
After creating a trigger on an insert I get this error: auction=> insert into bid values('mito',3,354); NOTICE: you bid the exact increment of 5 ERROR: fmgr_info: function 38667: cache lookup failed And the insert is not performed as it should. What does this error mean? TIA --

[GENERAL] rules on INSERT can't UPDATE new instance?

2000-05-20 Thread Louis-David Mitterrand
s in the bid table would be set to 0.1 _except_ the newly inserted row. Am I missing something obvious? TIA -- Louis-David Mitterrand - [EMAIL PROTECTED] - http://www.apartia.fr