[GENERAL] CASE for Postgres

2001-09-28 Thread Viktor M. Gnitiyov
Hi ALL. What CASE you are use for DB designing? Thanks. - Viktor M. Gnitiyov ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html

Re: [GENERAL] showing also value '0' with aggregate count()

2001-09-28 Thread Janning Vygen
Am Donnerstag, 27. September 2001 19:01 schrieb David Christian: > > btw: intersting point is, that the solution with union doesnt > > work when client_id might be null. > > > > dont knwo why ... > > In this case, use "select all". Though, I advise against null > fields in this table. Something

Re: [GENERAL] PgSQL behind a firewall

2001-09-28 Thread Holger Klawitter
nmilet wrote: > > The question now is how can I set a ssh tunnel (I try to recompile postgres > with openssl support > but I did not succeed), and then can I use a ssh tunnel from Java (perharps > yes by specifying the > port number in connection). That's not difficult: 1.) Establish a ssh conn

Re: [GENERAL] Function Help

2001-09-28 Thread Masaru Sugawara
Brian C. Doyle <[EMAIL PROTECTED]> wrote: > I am working on a function to determine the date of the first saturday of > the month. > > Currently I have: > > CREATE FUNCTION first_saturday(date) > RETURNS date > AS ' > Select CASE WHEN date_part(\'dow\',\'$1\'::DATE)=0 THEN date(\'$1\')+6 > WHE

[GENERAL] Recreating unique index for primary key

2001-09-28 Thread Ryan Ho
Hi, I've dropped an primary key index in order to re-create it. but i realized that i can't recreate a primary key index. Will a unique index be an adequate replacement? will the database integrity be at risk as a result? Thanks! -- Ho Siaw Ping, Ryan ---(end of broad

[GENERAL] converting to german date format

2001-09-28 Thread Janning Vygen
Hi, i have different databases with have columns of type 'date'. my application converts the date format to german date format like 09-28-2001 to 28.09.2001 and back again if the user enters a german date format. are there any solutions to do stuff like this inside the database? i am thinking

Re: [GENERAL] virtual filesystem atop a PostgreSQL database

2001-09-28 Thread Frank Joerdens
On Tue, Sep 25, 2001 at 01:48:26PM -0700, Marshall Spight wrote: > "Jan Pruner" <[EMAIL PROTECTED]> wrote in message > 0109251451420D.01444@jpr">news:0109251451420D.01444@jpr... > > Hmm, filesystem IS database. > > If you need SQL-like functionality to ask for something in your fs why do > > you

Re: [GENERAL] PgSQL behind a firewall

2001-09-28 Thread Holger Klawitter
Nicolas Milet wrote: > > Hi all, > > How can I connect to a remote database that is protected by a firewall. I`m > using Java and JDBC. > I try to sep up a SSL connection but didn't succeed. You can open the port in the firewall (note that the world may acces your DB now) or use a ssh tunnel.

[GENERAL] TRIGGER and function

2001-09-28 Thread Sameer Maggon
Hi, I want to create a trigger and a function which that trigger calls I want that whatever rows are added in the particular document... are then added to a temporary document through a function... Can nebody help me with that function,, Sameer

Re: [GENERAL] Quoting '?' placeholder in Perl's DBD::Pg?

2001-09-28 Thread Keary Suska
If that doesn't work, I would like to know, to avoid any hidden gotchas. I suppose it is considered uncommon to need this since most search techniques do not include punctuation. However, if one were to make extensive use of regex searches, this issue could occur often and engender much hair pulli

[GENERAL] boolean query

2001-09-28 Thread Ben-Nes Yonatan
Haloa! i got a boolean column (named 'seen') which contain the values '1' and '0' (depends on the item) now.. when i query the DB with the string "SELECT * FROM categories WHERE seen='1';" it brings me all of the items including those which seen='0' doesnt anyone know y? with thx in advance

[GENERAL] Triggers and rules

2001-09-28 Thread Mihai Gheorghiu
A table has TRIGGER BEFORE UPDATE, TRIGGER AFTER UPDATE and RULE ON UPDATE. 1. What is the order these three are executed? 2. Are the actions of one of them visible to the following ones, or they all refer strictly to the record before update? E.g.: If the TRIGGER BEFORE UPDATE changes a value in

[GENERAL] Dynamic Query problem

2001-09-28 Thread Dinesh Parikh
Dear All, I am new in postgres there for i have some problems. I am executing some type of Business rule in strored procedure using language plpgsql. When I am executing a Dynamic Query then It return an error which is some how unable to understand Please Help me It is urgent . I am attachi

[GENERAL] Triggers again

2001-09-28 Thread Mihai Gheorghiu
1) I have some TRIGGER BEFORE INSERT created explicitly, and other(s) created implicitly, through default constraints. What is their execution order? 2) Are the changes made by the first visible to the following ones? ---(end of broadcast)--- TIP 5

Re: [GENERAL] Authenticating user `postgres'

2001-09-28 Thread Arcady Genkin
Tom Lane <[EMAIL PROTECTED]> writes: > Arcady Genkin <[EMAIL PROTECTED]> writes: > > Tom Lane <[EMAIL PROTECTED]> writes: > >> Offhand I'd think it foolish to make it easier to get into the > >> superuser account than regular accounts anyway. > > > Not so much if the database only listens on uni

[GENERAL] boolean query

2001-09-28 Thread Ben-Nes Yonatan
Haloa! i got a boolean column (named 'seen') which contain the values '1' and '0' (depends on the item) now.. when i query the DB with the string "SELECT * FROM categories WHERE seen='1';" it brings me all of the items including those which seen='0' doesnt anyone know y? with thx in advance

[GENERAL] Temporary Table Problem

2001-09-28 Thread Dinesh Parikh
Dear all, I have a strange problem.Document says that one can create a temporary table in a session. I had created a temporary table in languge plpgsql.(Actually in a procedure). After completing my task I droped a table within a seesion(In same Function). Now problem arises. When I again c

[GENERAL] Fw: Problem Related to Goto

2001-09-28 Thread Dinesh Parikh
  Dear All I have a strange problem. Some documents suggests that I can use Goto statement. My program is like this one.   Drop function Gototest();Create Function Gototest() Returns int4 as'Declare    DBFirst int2;Begin    DBFirst := 1;    Start:    DBFirst:= DBFirst+1;       

Re: [GENERAL] UNIQUE constraint and indexing

2001-09-28 Thread Daniel M . Kurry
On Thu, Sep 27, 2001 at 06:30:50PM -0400, some SMTP stream spewed forth: > Is the index, created implicitely by "UNIQUE" constraint, the same > kind as created explicitely with "CREATE INDEX"? In other words, > is the following piece of SQL redundant? > > create table foo ( >bar serial

[GENERAL] String functions

2001-09-28 Thread Mihai Gheorghiu
Is there any function that removes multiple blanks from within a string? Can any trick be played with the existing string functions without having to write a loop? Thank you all. ---(end of broadcast)--- TIP 2: you can get off all lists at once wit