Re: [SQL] to_date has beaten me...

2003-02-05 Thread Roberto Mello
On Thu, Feb 06, 2003 at 05:25:39PM +1300, Rodger Donaldson wrote: > On Wed, Feb 05, 2003 at 11:22:57PM -0500, Tom Lane wrote: > > Rodger Donaldson <[EMAIL PROTECTED]> writes: > > > values(to_date('06/Feb/2003:11:29:11 +13', 'DD/Mon/:HH24:MI:SS'),0,302, > > > > > Always inserts the correct

Re: [SQL] to_date has beaten me...

2003-02-05 Thread Rodger Donaldson
On Wed, Feb 05, 2003 at 11:22:57PM -0500, Tom Lane wrote: > Rodger Donaldson <[EMAIL PROTECTED]> writes: > > values (to_date('06/Feb/2003:11:29:11 +13', 'DD/Mon/:HH24:MI:SS'),0,302, > > > Always inserts the correct date, but sets the time to midnight. > > Um, well, yeah ... it's to_DATE,

Re: [SQL] to_date has beaten me...

2003-02-05 Thread Tom Lane
Rodger Donaldson <[EMAIL PROTECTED]> writes: > values(to_date('06/Feb/2003:11:29:11 +13', 'DD/Mon/:HH24:MI:SS'),0,302, > Always inserts the correct date, but sets the time to midnight. Um, well, yeah ... it's to_DATE, meaning it produces a result of type date. I think you wanted to_t

[SQL] to_date has beaten me...

2003-02-05 Thread Rodger Donaldson
Postgresql 7.2.3 insert intolog_entries values (to_date('06/Feb/2003:11:29:11 +13', 'DD/Mon/:HH24:MI:SS'),0,302, [... various other data elided ...]); Always inserts the correct date, but sets the time to midnight. Thinking this might be solved by shuffling with the source d

Re: [SQL] automatic time/user stamp - rule or trigger?

2003-02-05 Thread Neal Lindsay
Jan Wieck wrote: A rule will not work here because rules cannot cause the same action on the same table they are called for. A-ha! I guess that's what I wasn't understanding. Triggers it is then. Thanks, -Neal ---(end of broadcast)--- TIP 1: su

Re: [SQL] design question: status table+log table, indexes, triggers

2003-02-05 Thread Tom Lane
george young <[EMAIL PROTECTED]> writes: > This schema seemed logical at the outset, but the most common query is: > select m.machine_name, m.text, ml.status, ml.date >from machine m, machine_log ml >where m.machine_name=ml.machine_name and ml.date=(select max(date)from > machine_log whe

Re: [SQL] automatic time/user stamp - rule or trigger?

2003-02-05 Thread Jan Wieck
Achilleus Mantzios wrote: > > On Wed, 5 Feb 2003, Neal Lindsay wrote: > > > I have a table that I want to keep track of the user who last modified > > it and the timestamp of the modification. Should I use a trigger or a rule? > > > > CREATE TABLE stampedtable ( > > stampedtableid SERIAL PR

Re: [SQL] Postgresql To Oracle9i

2003-02-05 Thread Jan Wieck
Atul Pedgaonkar wrote: > > Hello, > > Atul here From india.Anyone who knows how to mirgrate the data from > postgresql7.2 to Oracle9i.Please give the idea or methood to transfer the > data. Use pg_dump to create separate schema and data (as INSERT statements) dumps. Edit the schema so th

[SQL] design question: status table+log table, indexes, triggers

2003-02-05 Thread george young
[postgresql-7.2, pgsql, linux] Here's a schema-design problem I've hit a few times -- it seems like there should be a better way: I have a machine table (140 rows), currently very static: machine(machine_name text NOT NULL, machine_id smallint NOT NULL, area text NOT NULL, text text NO

Re: [SQL] automatic time/user stamp - rule or trigger?

2003-02-05 Thread Achilleus Mantzios
On Wed, 5 Feb 2003, Neal Lindsay wrote: > I have a table that I want to keep track of the user who last modified > it and the timestamp of the modification. Should I use a trigger or a rule? > > CREATE TABLE stampedtable ( > stampedtableid SERIAL PRIMARY KEY, > updatestamp timestamp NO

Re: [SQL] [ADMIN] Problem with VACUUM

2003-02-05 Thread Tom Lane
Marcelo Pereira Tada <[EMAIL PROTECTED]> writes: >> NOTICE: Child itemid in update-chain marked as unused - can't continue repair_frag >> ERROR: No one parent tuple was found Try updating to 7.2.4; that should fix this. regards, tom lane ---(end

[SQL] automatic time/user stamp - rule or trigger?

2003-02-05 Thread Neal Lindsay
I have a table that I want to keep track of the user who last modified it and the timestamp of the modification. Should I use a trigger or a rule? CREATE TABLE stampedtable ( stampedtableid SERIAL PRIMARY KEY, updatestamp timestamp NOT NULL DEFAULT now(), updateuser name NOT NULL DEFAULT curre

[SQL] Problem with VACUUM

2003-02-05 Thread Marcelo Pereira Tada
Hello everybody! We have a problem with VACUUM FULL and the our PostgresSQL is very slow. On the try run the vacuum command, its returns: NOTICE: Child itemid in update-chain marked as unused - can't continue repair_frag ERROR: No one parent tuple was found vacuumdb: vacuum nube failed I t

Re: [SQL] Inserting a tab character

2003-02-05 Thread Christoph Haller
> > --- Luke Pascoe <[EMAIL PROTECTED]> wrote: > > I have a table which defines various possible file > > delimiters (CHAR(1) NOT > > NULL), for the moment it'll only contain comma and > > tab. Inserting a comma is > > easy, but inserting a tab is proving somewhat more > > difficult. > > > > How do

Re: [SQL] bytea

2003-02-05 Thread Christoph Haller
> > Thanks for your reply. But what I want to do is loading a file of a particular path with a sql > statement in psql. Why I need to care about how the file looks like? Thanks. > Because "non-printables" might not be properly escaped. If they are, just use the SQL COPY command as described in the

[SQL] Postgresql To Oracle9i

2003-02-05 Thread Atul Pedgaonkar
Hello, Atul here From india.Anyone who knows how to mirgrate the data from postgresql7.2 to Oracle9i.Please give the idea or methood to transfer the data. Thank you. Regards, Atul... ---(end of broadcast)--- TIP 5: Have you checked our ex

Re: [SQL] bytea

2003-02-05 Thread Adrian Chong
Hi Christoph, Thanks for your reply. But what I want to do is loading a file of a particular path with a sql statement in psql. Why I need to care about how the file looks like? Thanks. Adrian - Original Message - From: "Christoph Haller" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc:

Re: [SQL] bytea

2003-02-05 Thread Christoph Haller
> > I have a table containing a field of type bytea: > > CREATE TABLE a_table ( > a_field bytea > ); > > How can I import a file in a SQL script? What function I can use? > The documentation says as in PostgreSQL 7.2.1 (I doubt this changed significantly since) Octets of certain values must be

[SQL] bytea

2003-02-05 Thread Adrian Chong
Hello, I have a table containing a field of type bytea: CREATE TABLE a_table ( a_field bytea ); How can I import a file in a SQL script? What function I can use? Thank you very much. Adrian ---(end of broadcast)--- TIP 4: Don't 'kill -9' the

[SQL] Lock timeout detection in postgres 7.3.1

2003-02-05 Thread Muhammad Shariq Muzaffar
Hi I have recently migrated my database from MS Sql Server to postgresql 7.3.1. In MS SQL SERVER, it is very easy to set the lock time equals to zero on ROW LEVEL. So that if some other user try to access the same data, he/she will get the error immediately. I have tried to run the same code throug