You're right... but, it definitely does not work with the JDBC driver. I will investigate further.
On Thu, Aug 5, 2010 at 7:38 PM, Jeremy Evans <[email protected]> wrote: > On Aug 5, 2:40 pm, Rolf Hanson <[email protected]> wrote: >> quote_schema_table seems to make Sequel want to do things with schemas >> and tables that look like this: >> >> "RAW_SCHEMA"."USERS" >> >> this doesn't seem to be valid in postgres. What I want is just >> "RAW_SCHEMA.USERS". > > Um, that's not a schema qualified table. That's a regular table name > with an embedded period. The way Sequel quotes schemas on PostgreSQL > (quoting the schema and table name separately) is correct: > > $ psql -U postgres sequel_test > sequel_test=# CREATE TABLE "public.foo" (a integer); > CREATE TABLE > sequel_test=# CREATE TABLE "public"."foo" (a integer); > CREATE TABLE > sequel_test=# INSERT INTO "public.foo" VALUES (1); > INSERT 0 1 > sequel_test=# INSERT INTO "public"."foo" VALUES (2); > INSERT 0 1 > sequel_test=# INSERT INTO "foo" VALUES (3); > INSERT 0 1 > sequel_test=# SELECT * FROM "foo"; > a > --- > 2 > 3 > (2 rows) > > sequel_test=# SELECT * FROM "public"."foo"; > a > --- > 2 > 3 > (2 rows) > > sequel_test=# SELECT * FROM "public.foo"; > a > --- > 1 > (1 row) > > sequel_test=# SELECT * FROM public.foo; > a > --- > 2 > 3 > (2 rows) > > sequel_test=# SELECT * FROM "public"."public.foo"; > a > --- > 1 > (1 row) > >> I've overridden this in my own Database class for creating tables: >> >> class Database >> def quote_schema_table(table) >> schema, table = schema_and_table(table) >> "#{"#{schema}." if schema}#{table}" >> end >> end >> >> However, sequel is still trying to do inserts into "RAW_SCHEMA"."USERS" >> >> is there another place I need to override quote_schema_table? Or is >> there another function I need to change? > > quote_schema_table is a dataset method, not a database method, so you > would need to override in the dataset class for your adapter. Not > that you would actually want to do this. > > Jeremy > > -- > You received this message because you are subscribed to the Google Groups > "sequel-talk" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/sequel-talk?hl=en. > > -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en.
