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

2001-03-06 Thread Karel Zak
On Mon, Mar 05, 2001 at 08:39:05PM -0800, Josh Berkus wrote: > Bruce, Tom, et. al., > > I can't find any documentation for what masks to use with the function > TO_CHAR(INTERVAL, mask). Is there a TO_CHAR(INTERVAL)? If so, what > masks are there? If not, how would you suggest I con

[SQL] Problems with RULE

2001-03-06 Thread Jens Hartwig
Hello all, I tried to implement the following rule: if someone wants to delete a record from a table t_xyz (id integer, deleted boolean) the record should get a delete-flag (deleted = true). When this "pre-deleted" record is deleted for the next time it should be physically deleted from the datab

[SQL] Comparing dates

2001-03-06 Thread Markus Fischer
Hello, I've a SELECT statement on many joined Tabled and one of them has a date column called 'date_date'. When I fetch a date e.g. '02-03-2001', I get, say, 60 results back. When I now perform the same query with another date, lets take '03-03-2001', I get back about 70 results. When I now modi

Re: [SQL] Optimizing Query

2001-03-06 Thread Justin Long
Wow. I can't believe the difference. It didn't take too long. I'll set up a script in my etc/cron.weekly to run it... would there be any benefit to doing a vacuum analyze nightly? Justin Long At 11:10 PM 3/5/2001 -0500, you wrote: Justin Long <[EMAIL PROTECTED]> writes: > Ok, now I have another

Re: [SQL] Comparing dates

2001-03-06 Thread patrick . jacquot
Markus Fischer wrote: > Hello, > > I've a SELECT statement on many joined Tabled and one of them has > a date column called 'date_date'. When I fetch a date e.g. > '02-03-2001', I get, say, 60 results back. When I now perform the > same query with another date, lets take '03-03-2001', I get back

Re: [SQL] Comparing dates

2001-03-06 Thread dev
On 3/6/01, 4:38:41 PM, <[EMAIL PROTECTED]> wrote regarding Re: [SQL] Comparing dates: > Markus Fischer wrote: > > I've a SELECT statement on many joined Tabled and one of them has > > a date column called 'date_date'. When I fetch a date e.g. > > '02-03-2001', I get, say, 60 results back. When I

Re: [SQL] Comparing dates

2001-03-06 Thread Michael Fork
I am just wildly guessing here, but you initially stated that you queried on '02-03-2001' (Which I read as February 3, 2001 -- and I belive postgres does as well) which returned 60 results, and on '03-03-2001' (March 3, 2001), which returned 70 results. However, that is *not* the query your wrote

[SQL] platform independend db access?

2001-03-06 Thread Markus Wagner
Hi, I would like my C source code to compile under unix and windows. I am currently using the pg libs to access my database. Under Windows I'd like to use odbc. What's the most platform (and db) independend way to access the database? Since odbc comes from MS, I am still looking for something

Re: [SQL] Temp Tables & Connection Pooling

2001-03-06 Thread Ian Harding
Gerald Gutierrez wrote: > At 12:48 PM 3/2/2001 -0800, David Olbersen wrote: > >On Fri, 2 Mar 2001, Gerald Gutierrez wrote: > > > >->Recently I wanted to implement Dijkstra's algorithm as a stored procedure, > >->and finding that PL/PGSQL cannot return record sets, I thought about using > >->a tem

RE: [SQL] Help creating rules/triggers/functions

2001-03-06 Thread Sondaar Roelof
Hello Blaise, I included a script I used to build/maintain a database. It also includes triggers and history logging. I hope you can use it. In the DO NOT use this part are test things which might not be correct. Best regards, Roelof <> > -Original Message- > From: Blaise Carrupt [SMT

Re: [SQL] Optimizing Query

2001-03-06 Thread Tom Lane
Justin Long <[EMAIL PROTECTED]> writes: > Wow. I can't believe the difference. It didn't take too long. I'll set up a > script in my etc/cron.weekly to run it... would there be any benefit to > doing a vacuum analyze nightly? Depends. A nightly vacuum is probably good practice, but you could s

Re: [SQL] Problems with RULE

2001-03-06 Thread dev
On 3/6/01, 7:11:48 AM, Jens Hartwig <[EMAIL PROTECTED]> wrote regarding [SQL] Problems with RULE: > Hello all, > I tried to implement the following rule: if someone wants to delete a record > from a table t_xyz (id integer, deleted boolean) the record should get a > delete-flag (deleted = true

Re: [SQL] platform independend db access?

2001-03-06 Thread clayton cottingham
Markus Wagner wrote: > > Hi, > > I would like my C source code to compile under unix and windows. I am > currently using the pg libs to access my database. Under Windows I'd like > to use odbc. > > What's the most platform (and db) independend way to access the database? > Since odbc comes from

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

2001-03-06 Thread Josh Berkus
Karel, > The 'interval' version of to_char() isn't implemented -- may be in 7.2 > (it's high in my TODO list:-) Grazie. (One of the things I love about PostgreSQL is being able to get definitive answers on functionality -- try asking Microsoft an "is this implemented?" question!)

[SQL] Quick question MySQL --> PgSQL

2001-03-06 Thread Josh Berkus
Folks, Just a quick question ... I need to do a regular transfer (daily + on demand) of data from a MySQL database to a PostgreSQL database and back again. Can anybody steer me towards a good script for this, or do I have to write my own in PHP? Sorry to bother everyone with som

Re: [SQL] Quick question MySQL --> PgSQL

2001-03-06 Thread Brett W. McCoy
On Tue, 6 Mar 2001, Josh Berkus wrote: > Just a quick question ... I need to do a regular transfer (daily + on > demand) of data from a MySQL database to a PostgreSQL database and back > again. Can anybody steer me towards a good script for this, or do I > have to write my own in PHP? Don

Re: [SQL] Problems with RULE

2001-03-06 Thread dev
On 3/6/01, 7:11:48 AM, Jens Hartwig <[EMAIL PROTECTED]> wrote regarding [SQL] Problems with RULE: > Hello all, > I tried to implement the following rule: if someone wants to delete a record > from a table t_xyz (id integer, deleted boolean) the record should get a > delete-flag (deleted = true

Re: [SQL] Quick question MySQL --> PgSQL

2001-03-06 Thread The Hermit Hacker
v7.1's contrib directory has the mysql->pgsql script that was used for the SourceForge migration ... its also downloadable at http://www.pgsql.com->Downloads On Tue, 6 Mar 2001, Brett W. McCoy wrote: > On Tue, 6 Mar 2001, Josh Berkus wrote: > > > Just a quick question ... I need to do a r

Re: [SQL] Quick question MySQL --> PgSQL

2001-03-06 Thread clayton cottingham
"Brett W. McCoy" wrote: > > On Tue, 6 Mar 2001, Josh Berkus wrote: > > > Just a quick question ... I need to do a regular transfer (daily + on > > demand) of data from a MySQL database to a PostgreSQL database and back > > again. Can anybody steer me towards a good script for this, or do

Re: [SQL] Quick question MySQL --> PgSQL

2001-03-06 Thread dev
On 3/6/01, 5:26:18 PM, Josh Berkus <[EMAIL PROTECTED]> wrote regarding [SQL] Quick question MySQL --> PgSQL: > Folks, > Just a quick question ... I need to do a regular transfer (daily + on > demand) of data from a MySQL database to a PostgreSQL database and back > again. Can anybody st

Re: [SQL] Quick question MySQL --> PgSQL

2001-03-06 Thread Bruce Momjian
> > > there is one in contrib > > as well there is some through freshmeat.net There are two in /contrib. One from pgsql.com, and another from freshmeat.net: http://ziet.zhitomir.ua/~fonin/code/ I would like to see these merged someday. -- Bruce Momjian|

Re: [SQL] Comparing dates

2001-03-06 Thread Jie Liang
I think if you cast it then works. e.g. '02-03-2001'::date '02-03-2001'::timestamp Jie LIANG St. Bernard Software 10350 Science Center Drive Suite 100, San Diego, CA 92121 Office:(858)320-4873 [EMAIL PROTECTED] www.stbernard.com www.ipinc.com On Tue, 6 Mar 2001, Markus Fischer wrote: > Hell

Re: [SQL] How do I use text script containing SQL?

2001-03-06 Thread Andrew Perrin
psql \i filename.txt -Andy Perrin "Jeff S." wrote: > > I want to build my tables by placing all the sql > statements in a file. What is the correct way to use > this file with psql? > > Example: My text file has this in it: > > CREATE TABLE table1 ( >table1_id serial, >field1 char(5

Re: [SQL] Problems with RULE

2001-03-06 Thread Tom Lane
"Jens Hartwig" <[EMAIL PROTECTED]> writes: > I tried to implement the following rule: if someone wants to delete a record > from a table t_xyz (id integer, deleted boolean) the record should get a > delete-flag (deleted = true). When this "pre-deleted" record is deleted for > the next time it shou

[SQL] Re: [BUGS] Mis-firing of rules with a WHERE condition

2001-03-06 Thread Tom Lane
Richard Huxton ([EMAIL PROTECTED]) writes: > Jens Hartwig posted a question to pgsql-sql today (2001-03-06) > regarding rules with where conditions. It seems to be a bug and > applies to all rule-types. AFAICT this is not a bug but is operating as designed. The message you are getting: > richard

[GENERAL] Date question

2001-03-06 Thread Boulat Khakimov
Hi, Im a little bit stuck here. Does anyone know how to get date in format '-MM-DD' of a date one year from now. So for example today is '2001-03-06' I need to get date 12 months from now which will be '2002-03-06' in todays case... In mysql I used DATE_ADD(CURDATE(), INTERVAL 12 MONTH) ,

RE: [GENERAL] Date question

2001-03-06 Thread Mike Mascari
How about: SELECT '2001-03-06'::timestamp + '1 Year'; Hope that helps, Mike Mascari -Original Message- From: Boulat Khakimov [SMTP:[EMAIL PROTECTED]] Sent: Tuesday, March 06, 2001 2:20 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject:[GENERAL] Da

[GENERAL] Re: [SQL] Date question

2001-03-06 Thread Michael Fork
This will do it: mfork=# SELECT to_char(now() + '1 Year'::interval, '-MM-DD'); to_char 2002-03-06 (1 row) Michael Fork - CCNA - MCP - A+ Network Support - Toledo Internet Access - Toledo Ohio On Tue, 6 Mar 2001, Boulat Khakimov wrote: > Hi, > > Im a little bit stuck

RE: [SQL] Date question

2001-03-06 Thread Francis Solomon
Hi Boulat, stasis=# select (now() + '1 year')::date; ?column? 2002-03-06 (1 row) Hope this helps Francis > Hi, > > Im a little bit stuck here. > > Does anyone know how to get date in format '-MM-DD' of a date one > year from now. > So for example today is '2001-03-06' I

[SQL] Re: [GENERAL] Re: MySQLs Describe emulator!

2001-03-06 Thread Alfred Perlstein
* Boulat Khakimov <[EMAIL PROTECTED]> [010306 07:24] wrote: > > Karel Zak wrote: > > > On Tue, Mar 06, 2001 at 09:14:54AM -0500, Boulat Khakimov wrote: > > > Tom Lane wrote: > > > > > > > > Boulat Khakimov <[EMAIL PROTECTED]> writes: > > > > > Here is a nifty query I came up with > > > > > that p

Re: [SQL] Permissons on database

2001-03-06 Thread dev
On 3/6/01, 5:00:47 PM, Boulat Khakimov <[EMAIL PROTECTED]> wrote regarding [SQL] Permissons on database: > Hi, > How do I grant permissions on everything in the selected databes? > GRANT doesnt take as on object database name nor does it accept wild > chars By hand at the moment I'm afrai

Re: [GENERAL] MySQLs Describe emulator!

2001-03-06 Thread Boulat Khakimov
Tom Lane wrote: > > Boulat Khakimov <[EMAIL PROTECTED]> writes: > > Here is a nifty query I came up with > > that provides a detailed information on any row of any table. > > Something that is build into mySQL (DESC tablename fieldname) > > but not into PG. > > Er, what's wrong with psql's "\d t

[SQL] Re: MySQLs Describe emulator!

2001-03-06 Thread Karel Zak
On Tue, Mar 06, 2001 at 09:14:54AM -0500, Boulat Khakimov wrote: > Tom Lane wrote: > > > > Boulat Khakimov <[EMAIL PROTECTED]> writes: > > > Here is a nifty query I came up with > > > that provides a detailed information on any row of any table. > > > Something that is build into mySQL (DESC tab

[SQL] Re: [GENERAL] Date question

2001-03-06 Thread Peter Eisentraut
Boulat Khakimov writes: > Does anyone know how to get date in format '-MM-DD' of a date one > year from now. > So for example today is '2001-03-06' I need to get date 12 months from > now > which will be '2002-03-06' in todays case... > > In mysql I used DATE_ADD(CURDATE(), INTERVAL 12 MONTH

Re: [GENERAL] Re: MySQLs Describe emulator!

2001-03-06 Thread Boulat Khakimov
Karel Zak wrote: > > On Tue, Mar 06, 2001 at 09:14:54AM -0500, Boulat Khakimov wrote: > > Tom Lane wrote: > > > > > > Boulat Khakimov <[EMAIL PROTECTED]> writes: > > > > Here is a nifty query I came up with > > > > that provides a detailed information on any row of any table. > > > > Something th

Re: [GENERAL] Re: MySQLs Describe emulator!

2001-03-06 Thread Michelle Murrain
On Tuesday 06 March 2001 10:19 am, Boulat Khakimov wrote: > Karel Zak wrote: > > > On Tue, Mar 06, 2001 at 09:14:54AM -0500, Boulat Khakimov wrote: > > > > > > Tom Lane wrote: > > > > Boulat Khakimov <[EMAIL PROTECTED]> writes: > > > > > Here is a nifty query I came up with > > > > > that provides

Re: [SQL] Date question

2001-03-06 Thread Jie Liang
you can say: (now() + '1year'::timespan)::date Jie LIANG St. Bernard Software 10350 Science Center Drive Suite 100, San Diego, CA 92121 Office:(858)320-4873 [EMAIL PROTECTED] www.stbernard.com www.ipinc.com On Tue, 6 Mar 2001, Boulat Khakimov wrote: > Hi, > > Im a little bit stuck here.

Re: [SQL] Date question

2001-03-06 Thread clayton cottingham
Francis Solomon wrote: > > Hi Boulat, > > stasis=# select (now() + '1 year')::date; > ?column? > > 2002-03-06 > (1 row) > > Hope this helps > > Francis > > > Hi, > > > > Im a little bit stuck here. > > > > Does anyone know how to get date in format '-MM-DD' of a date one >

Re: [SQL] Re: [GENERAL] MySQLs Describe emulator!

2001-03-06 Thread Michael Fork
try starting psql with the -E option -- this displays all queries used internally to the screen, i.e.: bash-2.04$ psql -E * QUERY * SELECT usesuper FROM pg_user WHERE usename = 'mfork' * Welcome to psql, the PostgreSQL interactive terminal. Type: \copyri

[SQL] Permissons on database

2001-03-06 Thread Boulat Khakimov
Hi, How do I grant permissions on everything in the selected databes? GRANT doesnt take as on object database name nor does it accept wild chars -- Nothing Like the Sun ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go t

[GENERAL] Re: [SQL] Permissons on database

2001-03-06 Thread Oliver Elphick
Boulat Khakimov wrote: >Hi, > >How do I grant permissions on everything in the selected databes? > >GRANT doesnt take as on object database name nor does it accept wild >chars However you can give it a list of tables (and other objects). -- Oliver Elphick

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

2001-03-06 Thread Mathijs Brands
On Sun, Mar 04, 2001 at 10:01:37AM +0800, xuyifeng allegedly wrote: > - Original Message - > From: The Hermit Hacker <[EMAIL PROTECTED]> > To: Jaruwan Laongmal <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Friday, March 02, 2001 8:04 PM > Subject: Re: [HACKERS

[GENERAL] Undefined symbol

2001-03-06 Thread Boulat Khakimov
Hi, Im writing a function in C (encode) for PG that uses blowfish encryption here is how I compile it. gcc -I/usr/src/postgresql-7.0.3/src/include -I/usr/src/postgresql-7.0.3/src/backend -O2 -Wall -Wmissing-prototypes -Wmissing-declarations -lcrypt -I/usr/src/postgresql-7.0.3/src/interfaces/lib

Re: [SQL] Re: [GENERAL] Re: MySQLs Describe emulator!

2001-03-06 Thread Mathijs Brands
On Tue, Mar 06, 2001 at 04:37:32PM +0100, Karel Zak allegedly wrote: > On Tue, Mar 06, 2001 at 10:19:13AM -0500, Boulat Khakimov wrote: > > > > Karel Zak wrote: > > > > On Tue, Mar 06, 2001 at 09:14:54AM -0500, Boulat Khakimov wrote: > > > > Tom Lane wrote: > > > > > > > > > > Boulat Khakimov <[E

Re: [SQL] Undefined symbol

2001-03-06 Thread Mathijs Brands
On Tue, Mar 06, 2001 at 06:44:31PM -0500, Boulat Khakimov allegedly wrote: > testdb=# select encode('bob','bob'); > ERROR: Load of file /home/boulat/Funio.com/database/encode.so failed: > /home/boulat/Funio.com/database/encode.so: undefined symbol: > BF_cfb64_encrypt > > thats the function that

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

2001-03-06 Thread Xu Yifeng
Hello Mathijs, Wednesday, March 07, 2001, 7:46:01 AM, you wrote: MB> On Sun, Mar 04, 2001 at 10:01:37AM +0800, xuyifeng allegedly wrote: >> - Original Message - >> From: The Hermit Hacker <[EMAIL PROTECTED]> >> To: Jaruwan Laongmal <[EMAIL PROTECTED]> >> Cc: <[EMAIL PROTECTED]>; <[EMAIL

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

2001-03-06 Thread The Hermit Hacker
On Wed, 7 Mar 2001, Xu Yifeng wrote: > 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,

[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: Re[2]: [SQL] Re: [HACKERS] why the DB file size does notreduce when 'delete'the data in DB?

2001-03-06 Thread Tatsuo Ishii
> 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... It's not a bug bu

[SQL] Query Limitations

2001-03-06 Thread Keith Gray
PostgreSQL 6.4 seems to have limitations in Query Length when I "CREATE VIEW" ... is this limit defined further, when I create a query on a query... it seems to compound the queries and reach the limit sooner!! Is this limit programmable? Is it default higher in 7.0? What is the most stable

Re: [SQL] Query Limitations

2001-03-06 Thread Bruce Momjian
> PostgreSQL 6.4 seems to have limitations in Query Length when I > > "CREATE VIEW" ... is this limit defined > > further, when I create a query on a query... it seems to compound > the queries and reach the limit sooner!! > > Is this limit programmable? > > Is it default higher in 7.0? Yes.

[SQL] On Clusters

2001-03-06 Thread Mark Kirkwood
A previous posting mentioning clusters prompted me to revist some earlier tests done on clustered and unclustered data. It appears that currently ( 7.1beta5 ) the optimizer is unaware of any clustering on a table - how important is that ? To answer this question I used by "pet" data warehouse

AW: [SQL] Problems with RULE

2001-03-06 Thread Jens Hartwig
JH: > > [...] > > I tried to implement the following rule: if someone wants to delete a record > > from a table t_xyz (id integer, deleted boolean) the record should get a > > delete-flag (deleted = true). When this "pre-deleted" record is deleted for > > the next time it should be physically dele

AW: [SQL] Problems with RULE

2001-03-06 Thread Jens Hartwig
Hello Richard, this was a very precise analysis - thanks for the effort you made! Nevertheless the Tom's explanation of the behaviour in case of views was sufficient for me. But still I don't understand the behaviour in my case ... Best regards, Jens PS: I use 7.1b4 ---