Re: [GENERAL] Trigger vs web service

2011-04-05 Thread Jorge Godoy
d. If you have code in the database, then checking how this specific function works there would also be worth a shot. -- Jorge Godoy On Tue, Apr 5, 2011 at 09:16, Marc-André Goderre wrote: > > > I receive a long string (about 1 per second) than content many information. > For the

Re: [GENERAL] How to generate unique invoice numbers foreach day

2011-01-15 Thread Jorge Godoy
Why would you do that? You can always reset the sequence at the end of the day. -- Jorge Godoy On Sat, Jan 15, 2011 at 17:09, Andrus Moor wrote: > There are 365 days in year. > Do you really think pre-creating sequence for every day for every year is > best solution ? &

Re: [GENERAL] How to generate unique invoice numbers for each day

2011-01-15 Thread Jorge Godoy
Use a sequence. -- Jorge Godoy 2011/1/15 Andrus Moor > Invoice numbers have format yymmddn > > where n is sequence number in day staring at 1 for every day. > > command > > SELECT COALESCE(MAX(nullif(substring( substring(tasudok from 7), > '^[0-9]*&#x

Re: [GENERAL] Copy From suggestion

2010-12-20 Thread Jorge Godoy
With OpenOffice.org that 65K limit goes away as well... I don't know why it is still like that today for MS Office... It is almost 2011 and they still think 64K is enough? :-) -- Jorge Godoy On Mon, Dec 20, 2010 at 11:49, Mark Watson wrote: > Thanks, Adrian, > > I’ll

Re: [GENERAL] Linux

2010-11-04 Thread Jorge Godoy
better in your environment. I am more prone to use SuSE (SLES) as I have OpenSuSE on my laptop for years now. -- Jorge Godoy On Thu, Nov 4, 2010 at 13:00, Michael Gould < mgo...@intermodalsoftwaresolutions.net> wrote: > I know that this is probably a "religion" issue bu

Re: [GENERAL] Good candidate query for window syntax?

2010-09-10 Thread Jorge Godoy
Have you checked the OVERLAPS operator in the documentation? http://www.postgresql.org/docs/8.4/interactive/functions-datetime.html -- Jorge Godoy On Fri, Sep 10, 2010 at 10:03, Ketema Harris wrote: > Hello, I have a table defined as: > > CREATE TABLE demo AS > ( >

Re: [GENERAL] Cannot access various Postgres sites

2010-04-17 Thread Jorge Godoy
Make 8.8.4.4 primary and 8.8.8.8 secondary and try again. You can also try using OpenDNS servers. -- Jorge Godoy On Sat, Apr 17, 2010 at 11:57, Eric Ridge wrote: > I'm only subscribed to -general and -hackers, so if this message should go > to a different list, please feel fr

Re: [GENERAL] General Question about database -- redirection

2010-04-15 Thread Jorge Godoy
create database db_1 template db_2; This will create a new DB_1 using DB_2 as template. Otherwise, you'll change your code to connect to DB_2 instead of connecting to DB_1. -- Jorge Godoy On Thu, Apr 15, 2010 at 14:49, akp geek wrote: > dear all - > > I am n

Re: [GENERAL] serial columns with replication/cluster

2010-02-04 Thread Jorge Godoy
Sean, take a look at UUID type. It might suit you better than serial. Changing the increment also works, but puts a lot of restrictions on you (such as planning to prevent collision, having to change the increment on several nodes when adding a new node, etc.). Regards, -- Jorge Godoy

Re: [GENERAL] Shall I apply normalization in the following case?

2010-02-03 Thread Jorge Godoy
-- > width > area depth volume And so on. You'd benefit from a normalized structure, you'd have constraints checking for valid units and types and you wouldn't need join to get the resulting information. -- Jorge Godoy On Wed, Feb 3, 201

Re: [GENERAL] Experience with many schemas vs many databases

2009-11-15 Thread Jorge Godoy
became simpler and fast enough. This also allowed me to work with some other aggregates that provided very useful "global" statistics. -- Jorge Godoy On Sun, Nov 15, 2009 at 04:28, undisclosed user wrote: > Hello everyone, > > I have hit a wall on completing a solut

[GENERAL] Using WITH queries on VIEWs

2009-08-30 Thread Jorge Godoy
Hi! Is it possible to use WITH queries ( http://www.postgresql.org/docs/8.4/interactive/queries-with.html) on VIEWs? I have a rather complex view that I could optimize with it... Regards, -- Jorge Godoy

Re: [GENERAL] storing repeating dates / events

2008-09-06 Thread Jorge Godoy
on with them. -- Jorge Godoy <[EMAIL PROTECTED]> signature.asc Description: This is a digitally signed message part.

Re: [GENERAL] storing repeating dates / events

2008-09-06 Thread Jorge Godoy
> this? Along with the timestamp store a boolean that indicates if the event should consider the year or not. But you might surely design it better, specially for things that repeat on intervals other than yearly. -- Jorge Godoy <[EMAIL PROTECTED]> signature.asc Descript

Re: [GENERAL] upgrading from 8.1.4 to 8.3.3

2008-08-28 Thread Jorge Godoy
? > > Is there a more apropriate approach ? The dump & restore approach for major version upgrades is the appropriate, correct and documented way to upgrade. Check the docs and it is there. -- Jorge Godoy <[EMAIL PROTECTED]> signature.asc Description: This is a digitally signed message part.

Re: [GENERAL] Probably been asked a hundred times before.

2008-06-24 Thread Jorge Godoy
compile PG myself than switch to Fedora just because of a PostgreSQL package. Generating new RPMs / updating existing ones isn't so hard. -- Jorge Godoy <[EMAIL PROTECTED]> signature.asc Description: This is a digitally signed message part.

Re: [GENERAL] Database design questions

2008-06-18 Thread Jorge Godoy
reads instead of 1 thread for > all my questions? I would submit all of the questions in separate messages. It is tiresome to read everything, you'll loose a lot of context after one or two messages levels or reply and people won't read the email because of its size.

Re: [GENERAL] Source RPM for 8.3.3?

2008-06-14 Thread Jorge Godoy
gh... But I believe that it wouldn't be hard to have it added to the list. Specially to have more people using those "standard" RPM packages for all the distributions above. Regards, -- Jorge Godoy <[EMAIL PROTECTED]> -- Sent via pgsql-general ma

Re: [GENERAL] Check if table or View exists

2008-03-31 Thread Jorge Godoy
e the client schema first in the search path. Then, you should just call the function and it would follow the search path order and give you what you want without having to check anything. -- Jorge Godoy <[EMAIL PROTECTED]> -- Sent via pgsql-general mailing list (pgsql-general

Re: [GENERAL] Using tables in other PostGreSQL database

2008-03-27 Thread Jorge Godoy
e is insterested on the history for the same month but comparing it to the last three years history? A big mess... -- Jorge Godoy <[EMAIL PROTECTED]> -- 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] Connect to postgres from a dynamic IP

2008-03-03 Thread Jorge Godoy
he channell -- be it with SSL or SSH, for example -- will prevent the sniffer from being able to capture the hash, so your password will be safer. -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 5: don't forget

Re: [GENERAL] Connect to postgres from a dynamic IP

2008-03-03 Thread Jorge Godoy
specially to authenticate the connection. Opening your access to everyone without crypto sounds like something you don't want to do. Specially if users can change their own passwords... -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)---

Re: [GENERAL] Connect to postgres from a dynamic IP

2008-03-03 Thread Jorge Godoy
phy such as SSL for that. -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match

Re: [GENERAL] need some help on figuring out how to write a query

2008-02-23 Thread Jorge Godoy
gt; they want. Then just add more parameters to your function. Instead of just start date also include an optional period, in weeks, days, hours, whatever you think is the better granularity for this. So, in your interface, add the period and make "10" the default value

Re: [GENERAL] need some help on figuring out how to write a query

2008-02-22 Thread Jorge Godoy
oday: SELECT INTO weeks_avg avg(value) FROM table WHERE date BETWEEN start_date AND start_date+'10 weeks'::interval; start_date:=start_date + '1 week'::interval; END WHILE; Start from that and you'll have it done. (Of course, above is pseudo co

Re: [GENERAL] PostgreSQL 8.3.0 RPMs are available for download

2008-02-22 Thread Jorge Godoy
still just the client and server, without the bells and whistles :-) If you use other packages that depend on PG you can't use these. -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] longest prefix match

2008-02-20 Thread Jorge Godoy
you don't always receive area code, country code, etc.) -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org/

Re: [GENERAL]

2008-02-20 Thread Jorge Godoy
wn. Maybe the titles should allow guessing the contents better... Or maybe some items should be promoted to an upper level :-) It is very uncommon to go up to the latest level of an index in a summary. -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadca

Re: [GENERAL] the feasibility of sending email from stored procedure in Postgres

2008-02-17 Thread Jorge Godoy
FY as an useful tool for sending emails, though. -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so th

Re: [GENERAL] Universal libpq.a ?

2008-02-05 Thread Jorge Godoy
he hardest part: "that Tom would approve" :-) -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] [pgsql-advocacy] PostgreSQL Certification

2008-02-04 Thread Jorge Godoy
Em Monday 04 February 2008 14:38:31 Csaba Nagy escreveu: > Why don't you go ahead and create those special lists and make general > collect all of them ? Some sort of hierarchy of lists... if doable at > all, that could make everybody happy... That's an excellent idea.

Re: [GENERAL] PGSQL ERROR: FATAL: terminating connection due to administrator command

2008-02-04 Thread Jorge Godoy
ackend that was serving my application. Enable query logging and see what is happening. -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nom

Re: [GENERAL] [OT] "advanced" database design (long)

2008-02-04 Thread Jorge Godoy
> are more efficient. I'd say 1 byte every 8 NULLs instead of 1 bit. If you only have 1 NULL, it will cost you 1 byte (not 1 bit). If you have 9, it will cost you 2 bytes (not 9 bits). -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Better alternative for Primary Key then serial??

2007-12-13 Thread Jorge Godoy
to > updates??? Shouldn't the definition of a primary key be an immutable thing that is unique to the row? If you change it, then it is not immutable anymore... You can also have triggers to prevent PK updates... But I wouldn't go this route. Why are you needing updating the PKs

Re: [GENERAL] Creating Aggregate functions in PLpgSQL

2007-12-13 Thread Jorge Godoy
ice if you could get ready before they tell you that they want doing some pF correction on the facility and you need to have that counted as well. -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Hijack!

2007-12-12 Thread Jorge Godoy
as > top-posters, except it is much worse because the actual text they wrote > is harder to find. The worst thing is people who bottom-posts at top-posted messages... Can you see the mess? -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)

Re: [GENERAL] Hijack!

2007-12-12 Thread Jorge Godoy
uess something that is there shouldn't be? :-) Always a good reference: http://www.goldmark.org/jeff/stupid-disclaimers/ -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match

Re: [GENERAL] Recommendations for a datasync scenario ?

2007-12-02 Thread Jorge Godoy
heir PK, so that there are no clashes and you don't need to rely on sequences and the correct value being used everywhere. It is the same kind of problem that we have on supermarkets and POSs: the POS has to sell even if the connection with the server is down. -- Jorge G

Re: [GENERAL] plpython array support

2007-11-19 Thread Jorge Godoy
sure, but I think that on 7.4 I already had code with arrays inside the database... -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] view management

2007-11-18 Thread Jorge Godoy
issued to prevent that need of dropping and recreating all dependent objects it would be great. A suboptimal alternative would be allowing the number of columns be greater than it was before -- i.e., add new columns to the view --, but block name changes for those columns and removing colu

Re: [GENERAL] any way for ORDER BY x to imply NULLS FIRST in 8.3?

2007-11-11 Thread Jorge Godoy
rmance gets better and better every time I optimize *any* of the two sides: application or database. It is always an enhancement, as if I was coding things directly by hand. -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] any way for ORDER BY x to imply NULLS FIRST in 8.3?

2007-11-08 Thread Jorge Godoy
ich is not very intuitive. I vote for sort_nulls_first defaulting to > false in order not to break bc. But then, when ordering by login date, you should use COALESCE and infinity for them (http://www.postgresql.org/docs/8.2/interactive/datatype-datetime.html). -- Jorge Godoy

Re: [GENERAL] Populating large DB from Perl script

2007-11-01 Thread Jorge Godoy
you have to respect the order you need to restore your data. -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] print command in sproc

2007-10-29 Thread Jorge Godoy
Em Tuesday 23 October 2007 07:17:53 Goboxe escreveu: > Hi, > > What is the equivalent MSSQL 'print' command in pg sproc? What does the MSSQL 'print' command "prints"? -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broad

Re: [GENERAL] Postgres SQL Client for Suse Linux

2007-10-29 Thread Jorge Godoy
ux. Sure! A lot of them. They include psql, OpenOffice.org, gda, ODBC and other. If you can be more specific it will be easier to help you. -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] select count() out of memory

2007-10-25 Thread Jorge Godoy
Putting the data inside the DB fast is part of the solution, getting it out fast to be processes / analyzed is another part. -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 4: Have you searched our list archiv

Re: [GENERAL] running postgres

2007-10-18 Thread Jorge Godoy
ill post it. > > > > Sorry again.. > > > > Ken > > We'll put it down as "thinking out loud" then. It happens. ;-) OK... But was it harder or easier than MS SQL Server? :-) -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broad

Re: [GENERAL] Crosstab Problems

2007-10-18 Thread Jorge Godoy
TICE? If I were using it and having this problem I'd rather have an ERROR. It isn't uncommon for people not look at their logs and it isn't uncommon for them just run command from some language using a database adapter that might not return the NOTICE output.

Re: [GENERAL] Suggestions for Remote Procedure Calls from PG, please?

2007-10-18 Thread Jorge Godoy
allow you to retrieve the row that has been changed and take your action based on that. -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Design Question (Time Series Data)

2007-10-04 Thread Jorge Godoy
umns (if you're searching using the value as a parameter, then index it as well) and this would be the basis of my design for this specific condition. Having good statistics and tuning autovacuum will also help a lot on handling new inserts and deletes. -- Jorge Godoy <[EMAIL PRO

Re: [GENERAL] COPY for .CSV files problem

2007-10-01 Thread Jorge Godoy
is data as a field in the table (otherwise, problems with COPY). Maybe > can I use catalog? COPY won't allow you to process your data. You either write something to insert record by record or you change your data to include the needed information before using COPY. I would change t

Re: [GENERAL] Postgresql and SSL

2007-09-20 Thread Jorge Godoy
On Thursday 20 September 2007 11:41:00 Tom Lane wrote: > "Albe Laurenz" <[EMAIL PROTECTED]> writes: > > Jorge Godoy wrote: > >> Even though one can require connections using only SSL on the > >> server side, I don't see a method (in pg_hba.conf) tha

Re: [GENERAL] Postgresql and SSL

2007-09-20 Thread Jorge Godoy
;krb5", "ident", "pam" or "ldap". Note that "password" sends passwords # in clear text; "md5" is preferred since it sends encrypted passwords. At least, this is what I understand by "client certificate"... -- Jorge Godoy &

Re: [GENERAL] Partial index with regexp not working

2007-09-12 Thread Jorge Godoy
ID and have "(anonymous)" when you have the IP address on the table (maybe even NULL, it all depends on what you want). -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] ON UPDATE trigger question

2007-09-12 Thread Jorge Godoy
e a huge table you might want to add a WHERE clause: "WHERE my_val IS NOT NULL". -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Suse RPM's

2007-08-03 Thread Jorge Godoy
hand, but would definitely draw more attention to OpenSuSE... I had a few cases where it had to be handed down because of the lack of updates -- not security related, of course -- to "older" releases). -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broa

Re: [GENERAL] Suse RPM's

2007-08-03 Thread Jorge Godoy
.13 ones for 10.0. I usually get a .src.rpm, the tarball and run rpmbuild -bb. It works fine and I have new packages very fast. -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Accent-insensitive search

2007-07-12 Thread Jorge Godoy
e world to have to use it and code things by yourself, but it works. -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMA

Re: [GENERAL] Can't change working directory to C:/Documents and Settings in Windows

2007-07-01 Thread Jorge Godoy
variation like that (I've seen ~2 due to some unknown reason). This looks like a Windows problem on finding directories with spaces in its name. The same happens with diacriticals... -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Can't change working directory to C:/Documents and Settings in Windows

2007-07-01 Thread Jorge Godoy
. This looks like that old Windows bug. Try using "Document~1" as the directory name. -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] Geographic data sources, queries and questions

2007-05-23 Thread Jorge Godoy
e ID's, > or is it better to store and search a 2 byte CHAR abbreviation? It all depends: surrogate primary keys or ... :-) (old flame starter) -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] Views- Advantages and Disadvantages

2007-05-10 Thread Jorge Godoy
for a useful subset of real-world functions ... not >> sure offhand what could be covered. > > If there are no INSERT, UPDATE or DELETE statements in the function? And all functions called from inside the one being run as well (recursive condition, of course)... -- Jorge Godoy <[EMAIL PROTECTED]> pgpijw7CEq76Z.pgp Description: PGP signature

Re: [GENERAL] Converting time to float

2007-04-27 Thread Jorge Godoy
NGUAGE plpgsql IMMUTABLE STRICT; The new one is CREATE OR REPLACE FUNCTION aux.f_v_measured_time_base10( p_measured_time INTERVAL, OUT o_measured_time_base10 FLOAT) AS $_$ DECLARE BEGIN o_measured_time_base10:=(EXTRACT(EPOCH FROM p_measured_time) / EXTRACT(

[GENERAL] Converting time to float

2007-04-27 Thread Jorge Godoy
es with hours, minutes and seconds to make this fit. My first idea is converting each part of the time individually by diving it by 1.0 (hours), by 60.0 (minutes) or by 3600.0 (for seconds) and then adding it all up... Of course I won't do the division for hours and I'm using floa

Re: [GENERAL] Audit-trail engine: getting the application's layer user_id

2007-04-25 Thread Jorge Godoy
one that works professionaly with PostgreSQL? They'd certainly do the work for you and you'll accomplish your target on the due date. -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Audit-trail engine: getting the application's layer user_id

2007-04-24 Thread Jorge Godoy
st have to be sure when you want the information and what information you need. Take a look at the ones available in pg_catalog for your specific PostgreSQL version. -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Audit-trail engine: getting the application's layer user_id

2007-04-24 Thread Jorge Godoy
nnection ID -> user", right? That's what's in that page: a UDF (user defined function) named getapplicationid() that will return the user login / name / whatever and triggers. What is preventing you from writing that? What is your doubt with regards to how create that fea

Re: [GENERAL] where clause help

2007-04-23 Thread Jorge Godoy
t;num_open_issues + num_provisioned + num_canceled < num_prods", without the AND and the other statement. -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org/

Re: [GENERAL] Passing arrays to stored procedures

2007-04-20 Thread Jorge Godoy
:bytea); > which results in: > ERROR: cannot cast type character varying to bytea You meant array or bytea? neo=# select '{1, 2, 3}'::int[]; int4 ----- {1,2,3} (1 record) neo=# -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadc

Re: [GENERAL] unique constraint on 2 columns

2007-04-20 Thread Jorge Godoy
); > > I need name_1 and name_2 to both be unique so that: > name_1 never appears in name_1 or name_2 > name_2 never appears in name_2 or name_1 > > > a standard 2 column unique index / constraint will not accomplish this. But

Re: [GENERAL] programmatic way to fetch latest release for a given major.minor version

2007-04-10 Thread Jorge Godoy
; Besides, that is sortable (unlike strings where 15 < 2) : But then, floats are as sortable as integers and 8.3 < 15.1... -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match

Re: [GENERAL] Is there a shortage of postgresql skilled ops people

2007-03-27 Thread Jorge Godoy
t of the test. Some people even cheat on tests (not that I'm saying it is done or is common with certification tests...). So, if I have a good memory to retain information for a week, I'll excel in certification tests. But then, what after that week? I'm against certifications for any product.

Re: Fwd: [GENERAL] Approximate join on timestamps

2007-03-20 Thread Jorge Godoy
nction when a query calls it with constant arguments. For example, a query like SELECT ... WHERE x = 2 + 2 can be simplified on sight to SELECT ... WHERE x = 4, because the function underlying the integer addition operator is marked IMMUTABLE.

Re: [GENERAL] Approximate join on timestamps

2007-03-20 Thread Jorge Godoy
ove_t1 else return below_t1 to find out the nearest time with regards to t1 when compared to a reference time that should be the time you're looking for. Do the same for t2... I haven't checked the docs if there's something that already makes your

Re: [GENERAL] Design / Implementation problem

2007-03-19 Thread Jorge Godoy
... But if you don't have any incentive, then why should you care buying something "now"? This is very common with miles for flights. If you fly often, you get upgrades, discounts, etc. If you don't, then you pay the fare as everybody else. -- Jorge Godoy <[EMAIL PROTE

Re: [GENERAL] Design / Implementation problem

2007-03-18 Thread Jorge Godoy
n just read the calculated value. Otherwise calculate it. If the user earns more points, make an entry at the raw table (for the expiration process) and increments today points. Do the same for points spent. -- Jorge Godoy <[EMAIL PROTECTED]> ---

Re: [GENERAL] Is This A Set Based Solution?

2007-03-16 Thread Jorge Godoy
I'd show a developer / designer that needs a new career... :-) -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] pg_dumpall and version confusion

2007-03-16 Thread Jorge Godoy
version confusion >> >> If you want that, create a wrapper program that calls to different >> statically compiled versions of pg_dump. > > I can't even begin to imagine how difficult that would be on Windows! As difficult as a new ".bat" file? -- Jorge God

Re: [GENERAL] Multiple TRIGGERs and OLD versus NEW "records"

2007-03-14 Thread Jorge Godoy
Tom Lane <[EMAIL PROTECTED]> writes: > Jorge Godoy <[EMAIL PROTECTED]> writes: >> If I change some column -- e.g. fill in some automatic calculated column or a >> timestamp column --, when I run the second trigger will OLD be the data >> stored >> at the

[GENERAL] Multiple TRIGGERs and OLD versus NEW "records"

2007-03-14 Thread Jorge Godoy
turned from the previous trigger? I know that NEW propagates, but does OLD change? I suppose not and I can't confirm that now... If anyone has the answer, sharing would be nice. If I don't get any answer, I'll test and post the results later. :-) TIA, -- Jorg

Re: [GENERAL] OT: Canadian Tax Database

2007-03-10 Thread Jorge Godoy
on server, errors / exceptions being risen and then catched by the client code that will translate them to a suitable message. Inserting data validation on client side helps with simple input and eliminate the average number of roundtrips needed for getting the data stored, but shouldn't b

Re: [GENERAL] Setting week starting day

2007-03-09 Thread Jorge Godoy
because PostgreSQL returns '1' for the date_part('week') considering Mondays as the first day of the week. Thanks, Omar. This makes the function easier to write. I hope it also solves your problem. Be seeing you, -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Setting week starting day

2007-03-09 Thread Jorge Godoy
Bruno Wolff III <[EMAIL PROTECTED]> writes: > On Fri, Mar 09, 2007 at 23:07:26 -0300, > Jorge Godoy <[EMAIL PROTECTED]> wrote: >> >> But how to get the date if the first day of the week is a Wednesday? This >> example is like the ones I've sen

Re: [GENERAL] Setting week starting day

2007-03-09 Thread Jorge Godoy
Bruno Wolff III <[EMAIL PROTECTED]> writes: > On Fri, Mar 09, 2007 at 20:13:11 -0300, > Jorge Godoy <[EMAIL PROTECTED]> wrote: >> Bruno Wolff III <[EMAIL PROTECTED]> writes: >> >> > No, it has to be inside the function so that the modular arithmet

Re: [GENERAL] Setting week starting day

2007-03-09 Thread Jorge Godoy
now()); date_part --- 10 (1 registro) neo=# Today is a day at the tenth week of the year. -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Setting week starting day

2007-03-09 Thread Jorge Godoy
er to write this it would be great ;-) -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match

Re: [GENERAL] Setting week starting day

2007-03-09 Thread Jorge Godoy
Perl packages I mentioned. If you just want a > function call, I'd suggest you create a function that just dispatches a call > to the Perl function that best meets your needs. In a sense, you are not > really rolling your own. You're just dispatching the call to a function in a > Perl package. And to do that you have to write a function... -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Setting week starting day

2007-03-09 Thread Jorge Godoy
Bruno Wolff III <[EMAIL PROTECTED]> writes: > No, it has to be inside the function so that the modular arithmetic is > applied to it. Then there's the error I've shown from your command. Can you give me a working one? This was with PostgreSQL 8.2.3. -- Jorge Godoy

Re: [GENERAL] Setting week starting day

2007-03-09 Thread Jorge Godoy
Bruno Wolff III <[EMAIL PROTECTED]> writes: > On Fri, Mar 09, 2007 at 14:59:35 -0300, > Jorge Godoy <[EMAIL PROTECTED]> wrote: >> It is not hard to calculate, as you can see... but it would be nice if >> "date_trunc('week', date)" could do that

Re: [GENERAL] Setting week starting day

2007-03-09 Thread Jorge Godoy
Alvaro Herrera <[EMAIL PROTECTED]> writes: > Jorge Godoy escribió: > >> Just to repeat my question: >> >> (I don't want to write a function, I can do that pretty easily... And I was >> asking if there existed some feature on the database that... It

Re: [GENERAL] Setting week starting day

2007-03-09 Thread Jorge Godoy
Bruno Wolff III <[EMAIL PROTECTED]> writes: > On Thu, Mar 08, 2007 at 20:32:22 -0300, > Jorge Godoy <[EMAIL PROTECTED]> wrote: >> Alvaro Herrera <[EMAIL PROTECTED]> writes: >> >> As I said, it is easy with a function. :-) I was just curious to see if

Re: [GENERAL] one-to-one schema design question and ORM

2007-03-09 Thread Jorge Godoy
you might end up using more memory / resources than you'd be willing to. If the RoR mapper can do lazy loadings, then this might not be too bad... Anyway, you might also add the extra table to make it a place to gather more information that will be relevant to your system only. -- Jorge Godoy

Re: [GENERAL] Beginner's Questions

2007-03-09 Thread Jorge Godoy
lf, unless I have to be. > My development boxes are a 1.1 GHz Athlon with 512 RAM with XP and a > dual-processor G4 with MacOS 10.4.) > > Are there ballpark requirements for what such a database will need to run? You have the required hardware. I have Postgr

Re: [GENERAL] Setting week starting day

2007-03-08 Thread Jorge Godoy
Alvaro Herrera <[EMAIL PROTECTED]> writes: > Jorge Godoy escribió: > >> I mean, if I wanted to do the above but instead of Sunday or Monday as the >> starting day I'd like using Fridays or Wednesdays... >> >> Is it possible? Writing a new function s

Setting week starting day (was: Re: [GENERAL] Tabulate data incrementally)

2007-03-08 Thread Jorge Godoy
o that they can send invoices on Friday). Being able to count "the first day of the 'week' 5 weeks from now" for the above situations would make things easier to code. :-) -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org/

Re: [GENERAL] Determine users and roles

2007-03-08 Thread Jorge Godoy
er cluster. Run the equivalent of "psql -E" in your command prompt and issue a "\du". Be seeing you, -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] No buffer space available

2007-03-08 Thread Jorge Godoy
ctions to the server did not change. Is there any > good reason for this error to start showing up? Did your Windows change? (Updates, service packs, etc.) -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Query timing

2007-03-04 Thread Jorge Godoy
with psql -f and grep for the desired lines only. -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] date format

2007-03-04 Thread Jorge Godoy
Garry Saddington <[EMAIL PROTECTED]> writes: > I have 'datestyle ISO,DMY' set in postgresql.conf but the date output is > still > rendered in the format (y,m,d) . How can I change this behaviour? ISO means y-m-d... -- Jorge Godoy <[EMAIL PROTECTED]>

Re: [GENERAL] rpm containing pgdump

2007-03-01 Thread Jorge Godoy
"Frank Church" <[EMAIL PROTECTED]> writes: > Which of the postgresql rpms contains pgdump. I have downloaded > postgresql-server and postgresql-libs and pgdump is not included. > Which rpm contains it? On my SuSE box it is the 'postgresql' RPM. --

  1   2   3   >