[SQL] Re: [PATCHES] Error in the date field (with NULL value...).Thanks!

2001-03-30 Thread Thomas Lockhart
> How can I "binds" PostgreSQL to consider '' as null ? You can modify src/backend/utils/{datetime,date,timestamp}.c to accept an empty string as a null value. But imho it is better to fix this in your input file, perhaps using sed: sed "s/''/NULL/g" < informix.dump > pg.dump

Re: [SQL] No Documentation for to_char(INTERVAL, mask)

2001-03-07 Thread Thomas Lockhart
> > Given the lack of to_char(interval), I'd like to write a PLPGSQL > > function to fill the gap in the meantime... > I mean is too much difficult write a 'interval' to_char() version in > some procedural language without access to real (internal) form of > 'interval'. I agree with Karel

Re: [SQL] No Documentation for to_char(INTERVAL, mask)

2001-03-07 Thread Thomas Lockhart
> I'll take a stab at in in PLPGSQL and post the results. OK. date_part() is your friend ;) - Thomas ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL

[HACKERS] Re: [SQL] Re: why the DB file size does not reduce when 'delete'the data in DB?

2001-03-06 Thread Thomas Lockhart
> do you really know the problem of PGSQL storage manager? it DOES NOT > reuse deleted record space. it also grows database size when you just > update but not insert record. it is a MS ACCESS like storage manager. > it is a functional bug. there is logic bug, performance bug... imho a designed-i

Re: [HACKERS] why the DB file size does not reduce when 'delete' the data in DB?

2001-03-02 Thread Thomas Lockhart
> I had deleted a very large number of records out of my SQL table in order to > decrease the harddisk space. But after I use command 'ls -l > /usr/local/pgsql/data/base/', it is found that the size of concerning files > do not reduce due to the effect of 'delete' SQL command. What should I do >

[HACKERS] Re: How to modify type in table?

2001-02-05 Thread Thomas Lockhart
>I am compiling postgresql 7.1beta4. How would i change the 8k row > limit? There is no 8k row limit anymore. But if there were, you would modify a #define in the source code and recompile (check the docs for more details). - Thomas

[SQL] Re: [INTERFACES] outer join in PostgreSql

2001-01-16 Thread Thomas Lockhart
Mauricio Hipp Werner wrote: > > I need help, which is the symbol used in postgreSql to carry out the outer > join. > > in oracle the is used (+) > in sybase the is used * and > in postgreSql? The PostgreSQL outer join is accomplished using SQL92 syntax. You will not find real outer joins *exce

Re: [SQL] 7.0.3 BUG

2000-11-30 Thread Thomas Lockhart
> >> ERROR: copy: line 3910, Bad timestamp external representation > >> '2000-01-05 00:00:60.00+08' > >> Weird because those timestamps were generated by default now(). ... > Is there a work-around to this aside from manually changing the dump file? > Distribution Version: Linux Mandrake

[SQL] Re: [HACKERS] [Fwd: Optimization in C]

2000-08-18 Thread Thomas Lockhart
> This solution isn't good when there are +1 tuples in the table, it's > slowly... anybody can help me ? : Someone already responded, and asked some questions about what you are really trying to do. If you didn't get the message, let us know or check the mail archives. Regards.

Re: [SQL] Time Aggregates

2000-08-02 Thread Thomas Lockhart
> I'm currently doing this: > SELECT symbol, date_trunc('minute', posted), > min(price), max(price), avg(price) > FROM trade > GROUP BY symbol, date_trunc('minute', posted); > to get a list of minute-averages of trade prices. I get the feeling > that this is bad form, that I should

Re: [SQL] Median

2000-07-18 Thread Thomas Lockhart
> Maybe someone else has an idea. I implemented a different algorithm several years ago. It is an O(log(N)) process (unlike most other techniques), and was borrowed from the "Algorithms" book (it's at work; but it is the classic "yellow jacket" book with Fortran code and the other volume with *re

Re: [SQL] SQL question

2000-07-16 Thread Thomas Lockhart
> The immediate cause of this gripe was discussed just a day or so ago > on one or another of the pgsql lists. The timestamp-to-date conversion > routine has this weird idea that it should kick out an error instead > of returning NULL when presented with a NULL timestamp. That's a bug > IMHO, an

Re: [SQL] Type conversion

2000-07-10 Thread Thomas Lockhart
> select TheNumberFromConsole/(select max(division_point) from table1) Try select '1234.5678'/(select max(division_point) from table1); The quotes around the apparent floating point number keeps Postgres from assuming that it *is* a floating point number, and it later decides that it must hav

Re: [SQL] Aww, sorry (last day of month)

2000-07-05 Thread Thomas Lockhart
> What i ment was, that I have information about workers, and I have to make > report on them. Report should contain status about workers with the > restriction , that the data is about last day of the month. I use perl as > a scripting language, and how the hell should I know how many days were i

Re: [SQL] Problem with joins

2000-07-05 Thread Thomas Lockhart
> I want to get a list of data sources with the corresponding data, > if the data exists, or with null, if the data doesn't. But anyway > I need the data sources (all of them). You want an outer join. Postgres doesn't have that yet, but you can mimic it. > I have also tried: > select source_nam

Re: [SQL] Need Help With Dates.

2000-07-03 Thread Thomas Lockhart
> I just migrated a database from MySQL to postgreSQL and am having trouble > wit postgres' dates. > MySQL dealt with dates very well, but i don't see the same sort of > functionality in postgres. ?? > The database is an archive of imformation, and i would like to do a cron'd > select for an int

Re: [SQL] extract last months data

2000-06-28 Thread Thomas Lockhart
> I just want to extract last months data, but I don't know whether the > month ended with 29,30 or 31 (external program, that uses postgres), select * from t1 where d >= (date_trunc('month', timestamp 'today') - interval '1 month') and d < date_trunc('month', timestamp 'today

Re: [SQL] JOIN syntax

2000-06-25 Thread Thomas Lockhart
> Looking at SQL92, it seems that I ought to be able to do this: > SELECT * FROM invoice INNER JOIN > (SELECT * FROM invoice_line WHERE lineno > 1) > ON invoice.invno = invoice_line.invno; > ERROR: parser: parse error at or near "(" Wrong syntax (for Postgres anyway). We don't yet have subsele

Re: [HACKERS] Re: [SQL] aliases break my query

2000-05-30 Thread Thomas Lockhart
> At one time Bruce had made some patches to emit informative notice > messages about implicit FROM entries, but that got turned off again > for reasons that I forget... It was triggered with common cases from the "outer join" syntax. It took a while to track down since it was introduced while I