Re: [SQL] Bitfields always atomic? Other way to store attributes?

2006-03-27 Thread Janning Vygen
Am Sonntag, 26. März 2006 23:47 schrieb Bryce Nesbitt: > Dear List; > > If I have two threads modifying the same "bit" field: > thread1=> update table set bf=bf | '01000' > thread2=> update table set bf=bf | '1' > Will this operation always be safe (e.g. result in bf='11000')? yes, T

Re: [SQL] Update in all tables

2006-02-22 Thread Janning Vygen
Am Mittwoch, 22. Februar 2006 19:08 schrieb Judith: >Hello everybody I need to update a field with the same value in the > tables of my data base but this field exists in almost all tables and > has the same value, I don't want to code a script, so my question is if > there is some way to updat

Re: [SQL] Need help: Find dirty rows, Update, Delete SQL

2006-02-19 Thread Janning Vygen
Am Samstag, 18. Februar 2006 18:41 schrieb [EMAIL PROTECTED]: > Hello, > > I need a bit of help with some SQL. > I have two tables, call them Page and Bookmark. > Each row in Page can have many Bookmarks pointing to it, and > they are joined via a FK (Page.id = Bookmark.page_id). > > Page has a 'ur

Re: [SQL] Double query (limit and offset)

2005-10-19 Thread Janning Vygen
Am Dienstag, 11. Oktober 2005 17:11 schrieb Michael Landin Hostbaek: > List, > > I'm using the OFFSET / LIMIT combo in order to split up my query, so it > only parses 20 rows at a time (for my php-scripted webpage). > > I'm using two queries; the first basically doing a select count(*) from > [bla

Re: [SQL] Query aid

2004-12-16 Thread Janning Vygen
Am Donnerstag, 16. Dezember 2004 11:34 schrieb Roberto Fichera: > Hi all, > > I have a table acct as (username, terminatedate, terminatecause) > I would like to build a query which returns three columns orderd by data > like: > > date_trunc( 'day', terminatedate ) | count(cause1) | count(cause2) >

Re: [SQL] How do FKs work?

2004-10-11 Thread Janning Vygen
Am Sonntag, 10. Oktober 2004 15:01 schrieb Marc G. Fournier: > On Sun, 10 Oct 2004, Janning Vygen wrote: > > Am Sonntag, 10. Oktober 2004 02:43 schrieb Marc G. Fournier: > >> On Sat, 9 Oct 2004, Tom Lane wrote: > >>> "Marc G. Fournier" <[EMAIL PROTECTED

Re: [SQL] surrogate key or not?

2004-07-23 Thread Janning Vygen
Am Freitag, 23. Juli 2004 12:02 schrieb Kenneth Gonsalves: > ok, i'll rephrase the whole thing: > > i have a master table with two fields: > id serial unique > name varchar not null (and will be unique) > > i always make 'name' the primary key, and since it is the primary key, i > dont explicitly s

Re: [SQL] Is there an easy way to normalize-space with given string functions

2004-04-23 Thread Janning Vygen
Am Freitag, 23. April 2004 04:34 schrieb Tom Lane: > Janning Vygen <[EMAIL PROTECTED]> writes: > > i searched the function list and tried to combine to or more > > functions, but i miss a replace function which uses regular > > expressions. > > There isn't one

[SQL] Is there an easy way to normalize-space with given string functions

2004-04-22 Thread Janning Vygen
Hi, i am looking for something like $ SELECT btrim(replace(' too many spaces! ', '\s+',' '), ''); too many spaces i searched the function list and tried to combine to or more functions, but i miss a replace function which uses regular expressions. Do i have to write my own function or did

Re: [SQL] Informing end-user of check constraint rules

2003-06-22 Thread Janning Vygen
Am Sonntag, 22. Juni 2003 14:45 schrieb [EMAIL PROTECTED]: > I have not used column check constraints before, but I'd like to start > using then and so would I'll like to know if there is a direct way to > provide feedback to the end user about data validation rules expressed in > column check cons

Re: [SQL] Results from EXECUTE

2002-08-16 Thread Janning Vygen
Am Freitag, 16. August 2002 18:26 schrieb Alexander M. Pravking: > How can I obtain results from an EXECUTE statement > within a pl/PgSQL function? >From the docs: plpgsql-statements.html postgres 7.2.1 "The results from SELECT queries are discarded by EXECUTE, and SELECT INTO is not currently

Re: [SQL] Few Queries

2002-08-13 Thread Janning Vygen
Am Mittwoch, 14. August 2002 07:05 schrieb Sugandha Shah: > 1. I 'm firing a query and it returns the value in variable which I > need to pass to other query . Is this a right way to pass the > value ? I'm newbie to this Database and hence facing lot of > syntax problems. > > CREATE FUNCTION

Re: [SQL] Function error

2002-08-12 Thread Janning Vygen
Am Dienstag, 13. August 2002 08:06 schrieb Sugandha Shah: > Hi , > > I'm porting MS- SQL stored procedure to postgres . I'm getting this > error : > > Error occurred while executing PL/pgSQL function > sel_free_disk_space line 7 at SQL statement > SELECT query has no destination for result data. >

Re: [SQL] manipulating the database in plsql

2002-07-08 Thread Janning Vygen
Am Sonntag, 7. Juli 2002 20:40 schrieb teknokrat: > Is there any way to work with tables etc, in plsql? Can i get a get > a database handle to the local database? If not, is there any > chance for this to be implemented in the near future? I guess you mean plpgsql. you dont need a database hand

Re: [SQL] Joining three data sources.

2002-06-21 Thread Janning Vygen
Am Mittwoch, 19. Juni 2002 16:09 schrieb Masaru Sugawara: > On Wed, 19 Jun 2002 12:33:47 +0200 > > Janning Vygen <[EMAIL PROTECTED]> wrote: > > - > > Result Inter Mailand vs. AC ROM 2:1 > > team1_id|team2_id|goals1|goals2 > > 1

Re: [SQL] Problem with n to n relation

2001-10-09 Thread Janning Vygen
Am Dienstag, 9. Oktober 2001 17:38 schrieb Stephan Szabo: > > Yes you are right! It doesnt work. i thought i have tested it... > > > > But i dont understand your solution. Why did you insert foo in > > the person table? Dou want to use it as a foreign key? Maybe you > > just mistyped your alter t

Re: [SQL] Problem with n to n relation

2001-10-09 Thread Janning Vygen
Am Montag, 8. Oktober 2001 19:33 schrieb Stephan Szabo: > On Mon, 8 Oct 2001, Janning Vygen wrote: > > Am Montag, 8. Oktober 2001 18:09 schrieb Stephan Szabo: > > > On Mon, 8 Oct 2001, Janning Vygen wrote: > > > > but how do i reach my goal. It should not be al

Re: [SQL] Problem with n to n relation

2001-10-08 Thread Janning Vygen
Am Montag, 8. Oktober 2001 18:09 schrieb Stephan Szabo: > On Mon, 8 Oct 2001, Janning Vygen wrote: > > > but how do i reach my goal. It should not be allowed to have a > > person without any address?? > > Hmm, do you always have at least one known address at the tim

Re: [SQL] Problem with n to n relation

2001-10-08 Thread Janning Vygen
allowed to have a person without any address?? janning > At 12:39 PM 10/5/2001 +0200, Janning Vygen wrote: > >create table person ( > > idserial, > > name text > >); > > > >create table address ( > > id serial, > > street tex

[SQL] Problem with n to n relation

2001-10-05 Thread Janning Vygen
Hi, i create n to n relations like this, right? create table person ( idserial, name text ); create table address ( id serial, street text ... ); create table person2adress ( id serial, person_id integer not null references person(id), address_id integer not n