Skip to content

supautils is now a reserved prefix #212

@jmgunter

Description

@jmgunter

Bug report

Describe the bug

When running npx tsx seed.ts > supabase/seed.sql locally, the resulting seed.sql file contains a JavaScript object at the beginning that should not be present. This object appears to be a PostgreSQL warning/error object that's being written to stdout instead of stderr, corrupting the SQL file output.

The extraneous object at the beginning of the file is:

{
  severity_local: 'WARNING',
  severity: 'WARNING',
  code: '42602',
  message: 'invalid configuration parameter name "supautils.policy_grants", removing it',
  detail: '"supautils" is now a reserved prefix.',
  file: 'guc.c',
  line: '9729',
  routine: 'MarkGUCPrefixReserved'
}

This warning object is followed by valid SQL INSERT statements, but the presence of the JavaScript object at the top makes the seed.sql file invalid SQL and prevents it from being executed properly.

To Reproduce

Steps to reproduce the behavior:

  1. Set up a project with @snaplet/seed v0.98.0
  2. Create a seed script (seed.ts) that uses createSeedClient({ dryRun: true })
  3. Run the command: npx tsx seed.ts > supabase/seed.sql
  4. Open the resulting supabase/seed.sql file
  5. Observe the JavaScript warning object at the beginning of the file before the SQL statements

Expected behavior

The seed.sql file should contain only valid SQL statements. Any warnings, errors, or diagnostic messages from the seeding process should be written to stderr (not stdout), so they don't corrupt the redirected SQL output file.

Expected file should start directly with:

INSERT INTO public.organizations ...

Instead of having a JavaScript object before the SQL statements.

Screenshots

The first 10 lines of the corrupted seed.sql file:

{
  severity_local: 'WARNING',
  severity: 'WARNING',
  code: '42602',
  message: 'invalid configuration parameter name "supautils.policy_grants", removing it',
  detail: '"supautils" is now a reserved prefix.',
  file: 'guc.c',
  line: '9729',
  routine: 'MarkGUCPrefixReserved'
}
INSERT INTO public.organizations ...

System information

  • OS: macOS 26.0.1 (Build 25A362)
  • Node.js version: v24.10.0
  • Version of @snaplet/seed: 0.98.0
  • Database: Supabase (PostgreSQL)

Additional context

This issue is related to how @snaplet/seed handles PostgreSQL warnings/notices. The warning about supautils.policy_grants appears to be a legitimate PostgreSQL configuration warning, but it's being written to stdout where it contaminates the SQL output when using shell redirection.

The warning itself ("supautils" is now a reserved prefix) suggests this may be related to Supabase-specific extensions or configuration parameters that are no longer supported.

Workaround: Currently filtering the output to remove the first 10 lines after the content is generated would work, but this is fragile and shouldn't be necessary.

Impact: This prevents automated seeding workflows from functioning correctly, as the generated SQL file cannot be executed without manual editing to remove the JavaScript object.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions