Re: [GENERAL] user defined variable per session

2003-12-07 Thread Claudio Lapidus
> I need to create user defined variable in every database session. > In Sybase ASA is equivalent: > CREATE VARIABLE name TYPE; > > I need use this in views. Is it possible??? What about test=> \set myvar 5 test=> select :myvar; ?column? -- 5 (1 row) hth cl. --

Re: [GENERAL] last update time of a table

2003-12-07 Thread Claudio Lapidus
pg wrote: > I have some pulldown menus in a VB app which extract data > from a remote site with slow connection. And the data in those tables for > pulldowns changes rarely. So if the pulldown has to extract the data and > transmit it thru slow connection, the pulldown will take a few seconds to be

[GENERAL] marking record origin in views

2003-11-26 Thread Claudio Lapidus
Hello list I have two tables with identical structure, one holds 'correct' data (from an application standpoint) and the other has data 'in error'. Anyway, I need sometimes to query both tables at the same time, so I constructed an elementary view create view v1 as select * from t1 union select *

Re: [GENERAL] rounding timestamps

2003-11-24 Thread Claudio Lapidus
Joe Conway wrote: > Is this what you wanted? > > regression=# select to_char(timestamp(0) '2003-10-24 > 15:30:59.999','MMDDHH24MISS'); > to_char > > 20031024153100 > (1 row) Yes! Exactly! > > See: > http://www.postgresql.org/docs/current/static/datatype-datetime.html

Re: [GENERAL] "slicing" records

2003-10-16 Thread Claudio Lapidus
Jan Wieck wrote: > Oh, it's one of these _don't ask me why_ things ... well, then "what is > the target legacy system?" ... hehe. > Of course, "don't ask me why" is my own way of saying "I don't know why!" :-) > If there is a total upper maximum for the object length and it's not way > too obscene

[GENERAL] Client authentication

2003-09-25 Thread Claudio Lapidus
Hello We need to deny access to the database for regular users, while allowing access to admins and a variety of application scripts. If we use passwords, everything is fine while interactive, but could not devise a way for scripts to handle them. We also tried to set up ident authentication, bu

[GENERAL] psql prompt

2003-09-12 Thread Claudio Lapidus
Hello The command prompt for psql defaults to the database name, but is there a way to change it to some other string/value? TIA, cl. ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [GENERAL] absolute value fro timestamps

2003-09-03 Thread Claudio Lapidus
Bruce Momjian wrote: > Why would you want an abolute value of a negative interval? Because I'm trying to match pairs of records that satisfy certain criteria, one of which is that both records have a timestamp that *may* be slightly offset between them, so I substract the two and the result must b

Re: [GENERAL] Commercial postgresql

2003-09-02 Thread Claudio Lapidus
Lamar Owen wrote: > Nitpik: that should be 24/7/52, since there aren't 365 weeks in a year. Oh, great. It's just that 7*52 = 364. That leaves us with a full day to idle and still honor the SLA, right? Sorry, couldn't resist :) cl. ---(end of broadcast)-

[GENERAL] adding SERIAL to a table

2003-09-02 Thread Claudio Lapidus
Hello   Now perhaps this is a bit dumb, but...   I just populated a new table via \copy. After that, I realize that perhaps is a good thing to have a row identifier in it, so I try   clapidus=> alter table tickets add column rid serial;NOTICE:  ALTER TABLE will create implicit sequence "tic

Re: [GENERAL] [ADMIN] a problem

2003-08-25 Thread Claudio Lapidus
oo ;-) OK, Sharvari, it was me who asked this same thing a couple of weeks ago, so I'm transcribing here the fine advice from our guru Tom: ---------- "Claudio Lapidus" <[EMAIL PROTECTED]> writes: I need to modify a column which is current

Re: [GENERAL] Buglist

2003-08-22 Thread Claudio Lapidus
Bruno Wolff III wote: > On Fri, Aug 22, 2003 at 12:17:41 +0530, > Shridhar Daithankar <[EMAIL PROTECTED]> wrote: > > > > Idea of autovacuum is to reduce load on vacuum full. If you set shared_buffers > > higher and FSM properly for he update/delete load, autovacuum is expected to > > catch most o

Re: [GENERAL] Knowing how many records I just inserted

2003-08-14 Thread Claudio Lapidus
> How can I get that back out to bash, if I'm doing psql scripting? > An env. variable wouldn't work, since it would go away when psql > terminates. Capture the stdout of the psql command and pipe it through cut in order to get only the third word of output. your_shell_variable=`psql -c 'insert

Re: [GENERAL] Convert TimeStamp to Date

2003-07-23 Thread Claudio Lapidus
> template1=# insert into t values ('1993-08-10 17:48:41'); > INSERT 16980 1 So we are talking about August 10th, right? > template1=# select f1, date(f1), f1::date, cast(f1 as date) from t; > f1 |date| f1 | f1 > -++

[GENERAL] 7.4dev or beta version

2003-07-23 Thread Claudio Lapidus
Hello I'd like to give a try at the new version, referred in many places as 7.4dev but I'm unable to find a version named this way for download. Is it the same as dev/postgresql-snapshot.tar.gz ? Or is somewhere already a 7.4beta? When will the 7.4beta become available? cl.