Re: [BUGS] Bug #581: Sequence cannot be deleted

From: "Tom Innes" <tinnes(at)inforamp(dot)net>
To: "'Ian Barwick'" <barwick(at)gmx(dot)net>, "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, <pgsql-hackers(at)postgresql(dot)org>
Cc: <nbazin(at)ingenico(dot)com(dot)au>, "'Brent Verner'" <brent(at)rcfile(dot)org>
Subject: Re: [BUGS] Bug #581: Sequence cannot be deleted
Date: 2002-02-12 22:25:33
Message-ID: 000001c1b414$303834a0$6901a8c0@TGIDesktopW20
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

I have a similar problem. Where I have both long table names and long
column names. Has the increase of the NAMEDATALEN been targeted for a
release? From my perspective, I would prefer if the algorithm to determine
the sequence name was more of a function on the table name rather than a
combination of the table name and column name, as I have never created a
table that has more than one sequence in it.

I would also welcome the ability to have the drop table command drop the
sequence as well.

Tom

-----Original Message-----
From: pgsql-hackers-owner(at)postgresql(dot)org
[mailto:pgsql-hackers-owner(at)postgresql(dot)org]On Behalf Of Ian Barwick
Sent: February 12, 2002 4:58 PM
To: Tom Lane; pgsql-hackers(at)postgresql(dot)org
Cc: nbazin(at)ingenico(dot)com(dot)au; Brent Verner
Subject: Re: [HACKERS] [BUGS] Bug #581: Sequence cannot be deleted

On Tuesday 12 February 2002 21:48, Tom Lane wrote:
> I believe that the surprising-name problem will largely go away anyway
> as soon as we get around to increasing the default NAMEDATALEN. With
> a decent name length no one would ever see truncation in practice.

Sorry to butt in here, but I would second this suggestion. One of my
databases
has rather long-winded table and field names (mostly in German, which
doesn't
help much ;-). There aren't any which exceed 31 characters on their own, but
sequences can get scarily long, so I always build with NAMEDATALEN set to
128,
just to be on the safe side.

Is there any reason for the default value (31 characters?), or are there
any performance issues associated with longer values?

> Also, of course, what we really want is for SERIAL sequences to get
> dropped by themselves when the parent table is dropped, and then users
> don't need to know what the generated sequence name is ...

This would be nice.

Yours

Ian Barwick

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Marc Lavergne 2002-02-13 06:47:41 BLOB support is broken in the 7.2/7.3 JDBC driver, works in 7.1 driver java.sql.SQLException: ERROR: oidin: error in "\377\330\377\340... I'm on Linux 2.4.16 using JDK 1.4.0 but it fails in 1.3.1 as well. Here's a quick reproducible test case: -- start -- package sample.java.jdbc; import java.sql.*; import java.io.*; import java.util.*; class testBlob { public static void main(String args[]) { new testBlob(); System.exit(0); } public testBlob() { System.out.println("Let's begin the test ..."); String v_username = "postgre"; String v_password = "postgre"; String v_database = "jdbc:postgresql://127.0.0.1/TEST"; PreparedStatement v_pstmt = null; try { DriverManager.registerDriver(new org.postgresql.Driver()); Connection v_conn = DriverManager.getConnection( v_database, v_username, v_password); v_conn.setAutoCommit(false); File v_file = new File("/home/postgre/something.jpg"); FileInputStream v_fis = new FileInputStream(v_file); v_pstmt = v_conn.prepareStatement( "insert into lob_test (id,data) values (?,?)"); v_pstmt.setInt(1,2); v_pstmt.setBinaryStream(2,v_fis,(int)v_file.length()); System.out.println("now you see me"); v_pstmt.executeUpdate(); System.out.println("now you don't"); v_conn.commit(); v_fis.close(); v_pstmt.close(); } catch (IOException e_io) { System.out.println(e_io); } catch (SQLException e_sql) { System.out.println(e_sql); } System.out.println("You'll only get here with the 7.1 driver!"); } } -- end -- 01010101010101010101010101010101010101010101010101 Marc P. Lavergne [wk:407-648-6996] Product Development richLAVA Corporation -- "Anyone who slaps a 'this page is best viewed with Browser X' label on a Web page appears to be yearning for the bad old days, before the Web, when you had very little chance of reading a document written on another computer, another word processor, or another network." -Tim Berners-Lee (Technology Review, July 1996) 01010101010101010101010101010101010101010101010101 -- 01010101010101010101010101010101010101010101010101 Marc P. Lavergne [wk:407-648-6996] Product Development richLAVA Corporation -- "Anyone who slaps a 'this page is best viewed with Browser X' label on a Web page appears to be yearning for the bad old days, before the Web, when you had very little chance of reading a document written on another computer, another word processor, or another network." -Tim Berners-Lee (Technology Review, July 1996) java.sql.SQLException: ERROR: oidin: error in "\377\330\377\340... I'm on Linux 2.4.16 using JDK 1.4.0 but it fails in 1.3.1 as well. Here's a quick reproducible test case: -- start -- package sample.java.jdbc; import java.sql.*; import java.io.*; import java.util.*; class testBlob { public static void main(String args[]) { new testBlob(); System.exit(0); } public testBlob() { System.out.println("Let's begin the test ..."); String v_username = "postgre"; String v_password = "postgre"; String v_database = "jdbc:postgresql://127.0.0.1/TEST"; PreparedStatement v_pstmt = null; try { DriverManager.registerDriver(new org.postgresql.Driver()); Connection v_conn = DriverManager.getConnection( v_database, v_username, v_password); v_conn.setAutoCommit(false); File v_file = new File("/home/postgre/something.jpg"); FileInputStream v_fis = new FileInputStream(v_file); v_pstmt = v_conn.prepareStatement( "insert into lob_test (id,data) values (?,?)"); v_pstmt.setInt(1,2); v_pstmt.setBinaryStream(2,v_fis,(int)v_file.length()); System.out.println("now you see me"); v_pstmt.executeUpdate(); System.out.println("now you don't"); v_conn.commit(); v_fis.close(); v_pstmt.close(); } catch (IOException e_io) { System.out.println(e_io); } catch (SQLException e_sql) { System.out.println(e_sql); } System.out.println("You'll only get here with the 7.1 driver!"); } } -- end -- 01010101010101010101010101010101010101010101010101 Marc P. Lavergne [wk:407-648-6996] Product Development richLAVA Corporation -- "Anyone who slaps a 'this page is best viewed with Browser X' label on a Web page appears to be yearning for the bad old days, before the Web, when you had very little chance of reading a document written on another computer, another word processor, or another network." -Tim Berners-Lee (Technology Review, July 1996) 01010101010101010101010101010101010101010101010101 -- 01010101010101010101010101010101010101010101010101 Marc P. Lavergne [wk:407-648-6996] Product Development richLAVA Corporation -- "Anyone who slaps a 'this page is best viewed with Browser X' label on a Web page appears to be yearning for the bad old days, before the Web, when you had very little chance of reading a document written on another computer, another word processor, or another network." -Tim Berners-Lee (Technology Review, July 1996)
Previous Message Bruce Momjian 2002-02-12 22:24:53 Re: Bug #583: Wrong example in 7.2 Tutorial

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Copeland 2002-02-12 23:11:04 Re: [GENERAL] Feature enhancement request : use of libgda in
Previous Message Tom Lane 2002-02-12 22:17:01 Re: [BUGS] Bug #581: Sequence cannot be deleted