Re: [SQL] logging a psql script

2001-02-21 Thread Oliver Elphick
Ken Kline wrote: >Hello, > I would like my psql script to log everything that it does. psql -e -- Oliver Elphick[EMAIL PROTECTED] Isle of Wight http://www.lfix.co.uk/oliver PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47 6B 7E 3

Re: [SQL] pl/Perl

2001-02-21 Thread Jie Liang
FYI, My choice: if involving a lot of regular expressions, pl/Perl is better; if involving a lot of SQLs or other functions(or store procedures), then pl/pgsql is better. Jie LIANG St. Bernard Software Internet Products Inc. 10350 Science Center Drive Suite 100, San Diego, CA 92121 Office:(8

Re: [SQL] now() with microsecond granulity needed

2001-02-21 Thread Tom Lane
Daniel Wickstrom <[EMAIL PROTECTED]> writes: > the timeofday function seems to work: Hmm, exactly what I was thinking of, except that it returns a text rather than a timestamp (a strange choice...). It seems a little buggy as well because the formatting of the microseconds part is wrong --- will

[SQL] two tables - foreign keys referring to each other...]

2001-02-21 Thread Josh Berkus
Chris, > ..or generally: how do you create two crosslinked foreign keyed tables? > > hopefully an easy problem for the real professionals! No. The problem is: Why would you want to create two crosslinked foriegn-keyed tables? As an experienced SQL professional, this seems like a reci

Re: [SQL] pl/Perl

2001-02-21 Thread Alex Pilosov
On Wed, 21 Feb 2001, Jeff MacDonald wrote: > 1: can you call other stored procedures from within pl/Perl No. > 2: from within a pl/Perl script , can i do a select etc.. >i'm assuming no, because you cannot use DBI.. but just wondering >if there is a way.. Not currently. > 3: installing

Re: [SQL] now() with microsecond granulity needed

2001-02-21 Thread Daniel Wickstrom
> "Radoslaw" == Radoslaw Stachowiak <[EMAIL PROTECTED]> writes: Radoslaw> *** Tom Lane <[EMAIL PROTECTED]> [Tuesday, Radoslaw> 20.February.2001, 11:57 -0500]: >> > using now() to init TIMESTAMP fields I got resolution of one >> second. How > can I define DEFAULT in column (TIM

Re: [SQL] now() with microsecond granulity needed

2001-02-21 Thread Radoslaw Stachowiak
*** Tom Lane <[EMAIL PROTECTED]> [Tuesday, 20.February.2001, 11:57 -0500]: > > using now() to init TIMESTAMP fields I got resolution of one second. How > > can I define DEFAULT in column (TIMESTAMP type) to get higher > > time-resolution (TIMESTAMP supports microseconds). > > You could make a var

[SQL] pl/Perl

2001-02-21 Thread Jeff MacDonald
Hello Few questions about pl/perl as the docs on this are very sparse.. (i find that with our procedural language docs in general) 1: can you call other stored procedures from within pl/Perl 2: from within a pl/Perl script , can i do a select etc.. i'm assuming no, because you cannot use DBI

Re: [SQL] logging a psql script

2001-02-21 Thread Frank Joerdens
On Wed, Feb 21, 2001 at 04:51:00PM -0500, Ken Kline wrote: > Hello, >I would like my psql script to log everything that it does. > I set the following > > \set ECHO all > \o foo.txt > \qecho > > some sql, some ddl, etc... > > \o > > > But foo.txt only contains > > DROP > DROP > DROP > CR

[SQL] logging a psql script

2001-02-21 Thread Ken Kline
Hello, I would like my psql script to log everything that it does. I set the following \set ECHO all \o foo.txt \qecho some sql, some ddl, etc... \o But foo.txt only contains DROP DROP DROP CREATE CREATE CREATE I want it to contain everything that I see on the screen, what am I missing?

Re: [SQL] pl/Perl

2001-02-21 Thread Tom Lane
Jie Liang <[EMAIL PROTECTED]> writes: > My choice: > if involving a lot of regular expressions, pl/Perl is better; > if involving a lot of SQLs or other functions(or store procedures), > then pl/pgsql is better. Also consider pltcl, which has pretty nearly perl-equivalent regexp support, and can

Re: [SQL] pl/Perl

2001-02-21 Thread Jeff MacDonald
> > 1: can you call other stored procedures from within pl/Perl > No. darn. > > > 2: from within a pl/Perl script , can i do a select etc.. > >i'm assuming no, because you cannot use DBI.. but just wondering > >if there is a way.. > Not currently. darn. > > 3: installing it.. i instal

Re: [SQL] two tables - foreign keys referring to each other...

2001-02-21 Thread Grigoriy G. Vovk
I think, if it is relationship many-to-many (one admin can be in many institute, and one institute can has many admin, you should use relation table, see below. > -> here we go > BEGIN; -- begin table transaction -- Only Postgresql > CREATE TABLE institute_t ( > name

Re: [SQL] two tables - foreign keys referring to each other...

2001-02-21 Thread Frank Joerdens
On Tue, Feb 20, 2001 at 11:34:30PM -0800, Stephan Szabo wrote: > > You have to use ALTER TABLE to add the constraint to one of the tables. Maybe I am stating the obvious but you should make sure that you include the ALTER TABLE statements in the *.sql files that you use to create the tables, rat