Re: [SQL] Extract interdependent info from one table

2008-01-24 Thread Phillip Smith
> docnum | alias1 | alias2 | subclass_alias > ++-+ > 653219 | 3587 | Redraft | Reply > (1 row) > > What I'd really like is to BOTH Post AND reply, with the alias2 for both. > Hope this was as clear as mud? :) Absolutely clear as mud :P I think this mi

[SQL] Extract interdependent info from one table

2008-01-24 Thread Andrej Ricnik-Bay
Hi Guys, I can't quite wrap my head around this one ... I have \d docmaster Table "public.docmaster" Column | Type | Modifiers ++--- alias1 | integer| alias2 | character varyi

Re: [SQL] date format

2008-01-24 Thread Scott Marlowe
Please keep replies on list. Others might have input that will help. On Jan 24, 2008 11:24 AM, iuri de araujo sampaio <[EMAIL PROTECTED]> wrote: > Yes, I am trying to insert the string ´2008 7 22´ as a date. > and i can´t change the input format. Is that a edit the default format > type date, in

Re: [SQL] date format

2008-01-24 Thread Scott Marlowe
On Jan 24, 2008 2:06 AM, iuri de araujo sampaio <[EMAIL PROTECTED]> wrote: > hi, > > how to change the default format for type date? > I have created a field on a table: > > ## > create table tbl_inventory ( > item_id integer constraint c_pk primary key, > I. purchase_date date

Re: [SQL] ALTER TABLE DROP CONSTRAINT IF EXISTS ?

2008-01-24 Thread Scott Marlowe
On Jan 23, 2008 4:25 AM, Andreas Joseph Krogh <[EMAIL PROTECTED]> wrote: > Does PG have any way of doing $subject without writing a plpgsql-function > which does it by querying the catalog manually? No. ---(end of broadcast)--- TIP 6: explain analyz

Re: [SQL] date format

2008-01-24 Thread Adrian Klaver
On Thursday 24 January 2008 12:06 am, iuri de araujo sampaio wrote: > hi, > > how to change the default format for type date? > I have created a field on a table: > > ## > create table tbl_inventory ( > item_id integer constraint c_pk primary key, > I. purchase_date date, >

Re: [SQL] SQL tree duplication

2008-01-24 Thread tv
> Hi, > > I have the following kind of sql structure, in 3 levels: > > --- > create table documents ( > id serial, > name varchar(50), > primary key (id) > ); > > create table lines ( > id serial, > name varchar(50), > document_id integer, > primary key (id), > f

[SQL] SQL tree duplication

2008-01-24 Thread Philippe Lang
Hi, I have the following kind of sql structure, in 3 levels: --- create table documents ( id serial, name varchar(50), primary key (id) ); create table lines ( id serial, name varchar(50), document_id integer, primary key (id), foreign key (document_id) refere

Re: [SQL] date format

2008-01-24 Thread A. Kretschmer
am Thu, dem 24.01.2008, um 5:06:58 -0300 mailte iuri de araujo sampaio folgendes: > hi, > > how to change the default format for type date? You can change datestyle, a simple example: test=# select '30.12.2007'::date; ERROR: date/time field value out of range: "30.12.2007" HINT: Perhaps you

[SQL] date format

2008-01-24 Thread iuri de araujo sampaio
hi, how to change the default format for type date? I have created a field on a table: ## create table tbl_inventory ( item_id integer constraint c_pk primary key, I. purchase_date date, II. fabrication_date date, III. expiration_date date ); ## the er