Re: [SQL] Hash Join not using hashed index?

2000-06-28 Thread Tom Lane
Ang Chin Han <[EMAIL PROTECTED]> writes: > No evidence, but I was hoping that having a prehashed country_id > would speed things up a bit, since the seq scan on country could > be redundant, requring only a seq scan on city and a index (hash) > lookup on country. > Or maybe this is a related ques

Re: [SQL] Finding the names of inheriting classes

2000-06-28 Thread Thomas Swan
Thanks... At the same time I had a friend guide me through the system tables... :) - - Thomas Swan - - Graduate Student  - Computer Science - The University of Mississippi - - "People can be sorted into two fundamental groups, - those that divide peo

Re: [SQL] Finding the names of inheriting classes

2000-06-28 Thread Tom Lane
Thomas Swan <[EMAIL PROTECTED]> writes: > I'm at a loss on how identify or get the names of children of a parent class. Join pg_class against pg_inherits. regards, tom lane

[SQL] temporay table : error is repeated.

2000-06-28 Thread Patrick Coulombe
Let me try to explain why i want to use temporary tables, maybe you have others solutions for me (it's call experience) :) I use PHP to interact with postgres. 1) The "user" do is selection (form - checkbox). 2) Results. 3) Options : he can print it, save it, and make MODIFICATIONS. That's the

Re: [SQL] retrieving a serial number

2000-06-28 Thread Robert B. Easter
You can do something like this: $var = SELECT nextval('seq_name'); INSERT INTO master (id, ...) VALUES ($var, ...); INSERT INTO slave1 (id, ...) VALUES ($var, ...); ... You can do a \d master, in psql to find out the name of the sequence. For the SERIAL type, nextval('seq_name') is just its defa

Re: [SQL] HI! Problems with cursors into triggers

2000-06-28 Thread Robert B. Easter
On Wed, 28 Jun 2000, Andrés Mauricio Marín Restrepo wrote: > > HELLO! > > I'm making one trigger (plpgsql) and in the function i use CURSOR for to > > bring an elements and to take them to a variable but no me it does not > work, WHY? > > The script is: > > DROP TRIGGER miTrig on

[SQL] Finding the names of inheriting classes

2000-06-28 Thread Thomas Swan
This is actually two problems... I'm at a loss on how identify or get the names of children of a parent class. For example, I have three children of a parent class Cities : Big_Cities, Little_Cities, Not_Cities.   I know that I can do a select * from Cities* and get all rows from Cities and Citi

Re: [SQL] retrieving a serial number

2000-06-28 Thread Philip Hallstrom
There's probably a way to get that serial number. I think I remember reading that when you specify it as SERIAL, postgresql actually creates a separate sequence. If that's the case then you could do "SELECT currval('mysequence')" -- although I'm not sure what "mysequence" should be set to. The ot

Re: [SQL] Procedures cannot take more than 16 arguments

2000-06-28 Thread Tom Lane
>> Does anyone know the way of sending more than 16 parameters to function? Change the relevant parameters in config.h (there are two), rebuild, reinstall, initdb. Bruce Momjian <[EMAIL PROTECTED]> writes: > In 7.0, I could have sworn I had an #ifdef to go up to 32, but I don't > see it anymore.

Re: [SQL] Procedures cannot take more than 16 arguments

2000-06-28 Thread Bruce Momjian
[ Charset KOI8-R unsupported, converting... ] > Good day. > Does anyone know the way of sending more than 16 parameters to function? In 7.0, I could have sworn I had an #ifdef to go up to 32, but I don't see it anymore. -- Bruce Momjian| http://www.op.net/~candle [E

[SQL] Procedures cannot take more than 16 arguments

2000-06-28 Thread Andrey
Good day. Does anyone know the way of sending more than 16 parameters to function?   Best regards. Andrey

[SQL] retrieving a serial number

2000-06-28 Thread Lea, Michael
I have one table (call it "master") that, among other things, contains a serial number. I have a number of other tables (call them "slaves") that, among other things, contain a foreign key referring to the serial number in the first table. I will be inserting one row into the master table, and one

Re: [SQL] finding (and recycling) holes in sequences

2000-06-28 Thread Erik Tennant
There is a similar discussion going on in the jonas users mailing list.. Your approach below does not appear to be thread safe. There is no guarantee that the same value will not be selected twice on two concurrent inserts.. Even more so since it sounds like he is going to be doing the maxid() and

Re: [SQL] Hash Join not using hashed index?

2000-06-28 Thread Tom Lane
Ang Chin Han <[EMAIL PROTECTED]> writes: >> The planner could choose to use an indexscan on a hash index >> as an input for the join, but it'd only be likely to do so >> if there is a restriction clause matching the index. In your >> example you have only a join WHERE clause. > Well, in my origi

[SQL] HI! Problems with cursors into triggers

2000-06-28 Thread Andrés Mauricio Marín Restrepo
HELLO! I'm making one trigger (plpgsql) and in the function i use CURSOR for to bring an elements and to take them to a variable but no me it does not work, WHY? The script is: DROP TRIGGER miTrig on otro; DROP FUNCTION miFunc(); DROP TABLE otro; DROP TABLE cual; CREATE TABLE otro

Re: [SQL] extract last months data

2000-06-28 Thread Thomas Lockhart
> I just want to extract last months data, but I don't know whether the > month ended with 29,30 or 31 (external program, that uses postgres), select * from t1 where d >= (date_trunc('month', timestamp 'today') - interval '1 month') and d < date_trunc('month', timestamp 'today

Re: [SQL] extract last months data

2000-06-28 Thread Guillaume Perréal
Antti Linno wrote: > Lo. > Today I digged in manuals and other docs, but didn't find any hint, how > to get data from table, where some cols are in date or datetime format, > and the data was about last month, or about special month. > Psql help was unhelpful too. > Here's example: > In table wo

Re: [SQL] trigger or something else?

2000-06-28 Thread Karel Zak
On Wed, 28 Jun 2000, Emils Klotins wrote: > Hello, > > I have a table that has to have several fields with different names, > but equal content. Sounds stupid, but it is because I have 2 > different programs querying the same table for user information and > each of them uses differently nam

[SQL] trigger or something else?

2000-06-28 Thread Emils Klotins
Hello, I have a table that has to have several fields with different names, but equal content. Sounds stupid, but it is because I have 2 different programs querying the same table for user information and each of them uses differently named fields. Eg. I have fields passwd and password. When

[SQL] extract last months data

2000-06-28 Thread Antti Linno
Lo. Today I digged in manuals and other docs, but didn't find any hint, how to get data from table, where some cols are in date or datetime format, and the data was about last month, or about special month. Psql help was unhelpful too. Here's example: In table workers is data with different date.

[SQL] Selecting outside the current DB

2000-06-28 Thread Ben Stringer
Does postgresql allow (or plan to provide) a select outside the current database? Eg. (In Sybase parlance) select * from otherdb..table Thanks, Ben -- _ Ben Stringer[EMAIL PROTECTED] -

Re: [SQL] Hash Join not using hashed index?

2000-06-28 Thread Tom Lane
Hash joins don't have anything to do with hash indexes. A hash join is a join that makes use of a temporary hashtable built on-the-fly *in memory* for that join. The planner could choose to use an indexscan on a hash index as an input for the join, but it'd only be likely to do so if there is a