[GENERAL] Re: [HACKERS] SPI example does not work for 7.1beta4

2001-03-23 Thread Limin Liu
> > --- > >SPI_connect(); > >SPI_exec("create temp table tbl_tmp (n int);",0); > >SPI_exec("insert into tbl_tmp values (1);",0); > >SPI_finish(); > > --- > > after InitPostgres and before setsigjmp(). > > I doubt this will work correctly without a transaction around it ... Thanks

[GENERAL] indexes not working very well

2001-03-23 Thread Vilson farias
Greetings, I have a little problem here and need some help. I created a table where indexes are not working very well here. Please take a look at the code below (it's easier). Two databases with same problem : 7.0.2 and 7.0.3 both on linux redhat 6.2. Am I doing something wrong? bxs=#

Re: [GENERAL] internationalizing text

2001-03-23 Thread Michael Fork
You can use a where clause when selecting from a veiew, so the following should work for you: CREATE VIEW my_view AS SELECT o.*, n.descr, n.lang FROM nation n, org o WHERE o.nation = n.code SELECT * FROM my_view WHERE n.lang = someKnownQuantity Michael Fork - CCNA - MCP -

RE: [GENERAL] Alter column length

2001-03-23 Thread Tamsin
I've used that method without any problems. I had to experiment a bit by creating test tables with different length columns to see what to set atttypmod to, because I didn't really know what the value meant! Seemed to work ok though... Tamsin > > - > update pg_attrib

Re: [GENERAL] Slow SELECT...IN statements

2001-03-23 Thread Bruce Momjian
[ Charset ISO-8859-1 unsupported, converting... ] > The FAQ states in entry 4.23 that SELECT...IN statements are slow and > recommends to use EXISTS...IN statements instead. It also states that this > will be resolved in some future version. > I didn't find any entries about that in the TODO list,

Re: [GENERAL] Alter column length

2001-03-23 Thread Tom Lane
"Dan Wilson" <[EMAIL PROTECTED]> writes: > I want to alter the length of a column without dumping an re-creating the > table. What kind of column? Offhand I think that hacking atttypmod would be safe for varchar(n) but not char(n). BTW, you might need to start a new backend session to see the e

[GENERAL] Re: Re: Rules, views, sequences and returned values

2001-03-23 Thread Gregory Wood
> > > I have a table and want to make a view updateable with rules. Table has a > > > sequence that creates default value to primary key when inserting. > > > > > > And now the question: Is it posible to return value of primary key from > > > rule of inserting with NEW? Is that value what i wo

Re: [GENERAL] internationalizing text

2001-03-23 Thread will trillich
On Fri, Mar 23, 2001 at 09:29:17AM -, Michael Ansley wrote: > I think that the standard way to do this is to use a resource identifier, > and then have a separate table with all strings. That's the way that most > internationalisation is done in programs, and it's probably not bad for > datab

Re: [GENERAL] Re: Rules, views, sequences and returned values

2001-03-23 Thread will trillich
On Fri, Mar 23, 2001 at 09:53:49AM -0500, Gregory Wood wrote: > > I have a table and want to make a view updateable with rules. Table has a > > sequence that creates default value to primary key when inserting. > > > > And now the question: Is it posible to return value of primary key from > >

Re: [GENERAL] Lost Trigger(s)?

2001-03-23 Thread Tom Lane
"Rod Taylor" <[EMAIL PROTECTED]> writes: > delete from user; <-- Simplest test case. Any deletion request fails > on this table. > ERROR: SPI_execp() failed in RI_FKey_cascade_del() Could we see the whole schema (pg_dump -s -t tablename dbname) for this table, and all the tables related to it

Re: [GENERAL] from string to table...?

2001-03-23 Thread will trillich
On Fri, Mar 23, 2001 at 07:53:39AM +, Richard Huxton wrote: > will trillich wrote: > > is there a way to write sql/plpgsql that'll take a varchar > > argument (table and field names) and be able to turn it into the > > appropriate query? > > You can use the "EXECUTE" statement in plpgsql (v7.

[GENERAL] Migration from MSAccess

2001-03-23 Thread Mihai Gheorghiu
1. Are there dynasets in PG (like in Access)? 2. I tried to export tables from Access95 to PG7.0.3-2 using ODBC Driver on the Win machine (PG is on a RH7.0). It worked fine with a simple table I created myself. Once I tried something real (many columns), I got errors - see log below: conn=5826

[GENERAL] Alter column length

2001-03-23 Thread Dan Wilson
I want to alter the length of a column without dumping an re-creating the table. I found this method in the archives and was just wondering if there are any side effects... - update pg_attribute set atttypmod = [column_oid] where attname = '[column_name]' where attrel

Re: [GENERAL] Lost Trigger(s)?

2001-03-23 Thread Stephan Szabo
On Thu, 22 Mar 2001, Rod Taylor wrote: > delete from user; <-- Simplest test case. Any deletion request fails > on this table. > ERROR: SPI_execp() failed in RI_FKey_cascade_del() Hmm, that error should probably include the constraint name for the constraint that failed. > There are a ton of

Re: [GENERAL] from string to table...?

2001-03-23 Thread Stephan Szabo
On Fri, 23 Mar 2001, will trillich wrote: > let's say you have the name of a table in a string. > > 'mytable' > > you also have field names, such as > > 'lookupfield' 'valuefield' > > which would be assembled like this > > select valuefield from mytable where lookupfield =

[GENERAL] Slow SELECT...IN statements

2001-03-23 Thread Jan Wessely
The FAQ states in entry 4.23 that SELECT...IN statements are slow and recommends to use EXISTS...IN statements instead. It also states that this will be resolved in some future version. I didn't find any entries about that in the TODO list, does anybody know when this will be fixed? PS: The maili

[GENERAL] Re: Rules, views, sequences and returned values

2001-03-23 Thread Gregory Wood
> I have a table and want to make a view updateable with rules. Table has a > sequence that creates default value to primary key when inserting. > > And now the question: Is it posible to return value of primary key from > rule of inserting with NEW? Is that value what i would get from extern

[GENERAL] Rules, views, sequences and returned values

2001-03-23 Thread DaVinci
Hello. Only a question. I have a table and want to make a view updateable with rules. Table has a sequence that creates default value to primary key when inserting. And now the question: Is it posible to return value of primary key from rule of inserting with NEW? Is that value what i would

[GENERAL] Lost Trigger(s)?

2001-03-23 Thread Rod Taylor
delete from user; <-- Simplest test case. Any deletion request fails on this table. ERROR: SPI_execp() failed in RI_FKey_cascade_del() There are a ton of cascaded deletes that should occur from the above deletion. Which one is failing -- how do I tell (can't seem to do any kind of comparison

[GENERAL] Error code when trying to insert non-unique value

2001-03-23 Thread Jonas Bengtsson
Hello, How can I check if the error that has occurred during an insert is because the inserted value is not unique when there are a unique error. I'm using PHP. Thanks in advance, Jonas Bengtsson ---(end of broadcast)--- TIP 5: Have you checked ou

RE: [GENERAL] internationalizing text

2001-03-23 Thread Michael Ansley
Title: RE: [GENERAL] internationalizing text I think that the standard way to do this is to use a resource identifier, and then have a separate table with all strings.  That's the way that most internationalisation is done in programs, and it's probably not bad for databases either. So maybe:

Re: [GENERAL] JOIN

2001-03-23 Thread Richard Huxton
Grant Furick wrote: > > Richard Thanks for the help. I now get a "OUTER JOIN is not yet supported" > from the Postgres DB though. Are you using this with postgres successfully? Don't know which version it's introduced in 7.0 or 7.1 - I'm running 7.1beta on my development rig. I think the first

Re: [GENERAL] from string to table...?

2001-03-23 Thread Richard Huxton
will trillich wrote: > > let's say you have the name of a table in a string. > > 'mytable' > > you also have field names, such as > > 'lookupfield' 'valuefield' > > which would be assembled like this > > select valuefield from mytable where lookupfield = '?' > > is t